From 5c8a9890297d00f6c23a3007c38277a7dd98629b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 27 Apr 2024 19:09:03 +0300 Subject: [PATCH 1/2] video: Remove nonsensical test Printing an unknown video format returns NULL, and with latest git main this actually causes a critical warning in addition. Part-of: --- gstreamer-video/src/video_format.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/gstreamer-video/src/video_format.rs b/gstreamer-video/src/video_format.rs index a3fdf6b11..41aa75889 100644 --- a/gstreamer-video/src/video_format.rs +++ b/gstreamer-video/src/video_format.rs @@ -480,13 +480,6 @@ mod tests { ); } - #[test] - #[should_panic(expected = "gst_video_format_to_string returned NULL")] - fn enum_to_string_panics() { - assert_eq!(&format!("{}", crate::VideoFormat::__Unknown(-1)), "UNKNOWN"); - assert_eq!(crate::VideoFormat::__Unknown(-1).to_str(), "UNKNOWN"); - } - #[test] fn test_display() { gst::init().unwrap(); From 241338f43c47d416eeede0aeae3f23448c23d2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 27 Apr 2024 19:09:55 +0300 Subject: [PATCH 2/2] audio: video: Improve Display trait impl test for AudioFormat and Video a bit Part-of: --- gstreamer-audio/src/audio_format.rs | 3 ++- gstreamer-video/src/video_format.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gstreamer-audio/src/audio_format.rs b/gstreamer-audio/src/audio_format.rs index eb7e337a2..1c5578e09 100644 --- a/gstreamer-audio/src/audio_format.rs +++ b/gstreamer-audio/src/audio_format.rs @@ -364,7 +364,8 @@ mod tests { fn test_display() { gst::init().unwrap(); - format!("{}", crate::AudioFormat::S16be); + assert_eq!(format!("{}", crate::AudioFormat::S16be), "S16BE"); + assert_eq!(format!("{:?}", crate::AudioFormat::S16be), "S16be"); } #[test] diff --git a/gstreamer-video/src/video_format.rs b/gstreamer-video/src/video_format.rs index 41aa75889..36828ca16 100644 --- a/gstreamer-video/src/video_format.rs +++ b/gstreamer-video/src/video_format.rs @@ -484,7 +484,8 @@ mod tests { fn test_display() { gst::init().unwrap(); - format!("{}", crate::VideoFormat::Nv16); + assert_eq!(format!("{}", crate::VideoFormat::Nv16), "NV16"); + assert_eq!(format!("{:?}", crate::VideoFormat::Nv16), "Nv16"); } #[test]