]> git.nihav.org Git - nihav.git/commitdiff
add test for missing codec descriptions
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 13 Feb 2019 09:56:33 +0000 (10:56 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 13 Feb 2019 09:56:33 +0000 (10:56 +0100)
nihav-allstuff/src/lib.rs
nihav-core/src/codecs/mod.rs

index 7c3ac618a12297830cd1ed26ae4edca4cb064c37..4f712f3cd704ee178c21eb74d68fdfeba2fb9f5a 100644 (file)
@@ -40,3 +40,27 @@ pub fn nihav_register_all_demuxers(rd: &mut RegisteredDemuxers) {
     rad_register_all_demuxers(rd);
     realmedia_register_all_demuxers(rd);
 }
+
+#[cfg(test)]
+mod test {
+    use super::*;
+    use nihav_core::register::get_codec_description;
+
+    #[test]
+    fn test_descriptions() {
+        let mut rd = RegisteredDecoders::new();
+        nihav_register_all_codecs(&mut rd);
+        let mut has_missing = false;
+        for dec in rd.iter() {
+            print!("decoder {} - ", dec.name);
+            let ret = get_codec_description(dec.name);
+            if let Some(desc) = ret {
+                println!("{}", desc);
+            } else {
+                println!("missing!");
+                has_missing = true;
+            }
+        }
+        assert!(!has_missing);
+    }
+}
index 2999cb66315cd47b33481e0c5ae73fe97caccafd..bf4fbd411edf9032afdd7f511dba364704f5b94f 100644 (file)
@@ -267,4 +267,7 @@ impl RegisteredDecoders {
         }
         None
     }
+    pub fn iter(&self) -> std::slice::Iter<DecoderInfo> {
+        self.decs.iter()
+    }
 }