]> git.nihav.org Git - nihav.git/commitdiff
fix the rest of tests
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 17 Jan 2019 17:39:45 +0000 (18:39 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 17 Jan 2019 17:39:45 +0000 (18:39 +0100)
18 files changed:
nihav-game/src/codecs/gremlinvideo.rs
nihav-indeo/Cargo.toml
nihav-indeo/src/codecs/imc.rs
nihav-indeo/src/codecs/indeo2.rs
nihav-indeo/src/codecs/indeo3.rs
nihav-indeo/src/codecs/indeo4.rs
nihav-indeo/src/codecs/indeo5.rs
nihav-indeo/src/codecs/intel263.rs
nihav-indeo/src/lib.rs
nihav-realmedia/src/codecs/cook.rs
nihav-realmedia/src/codecs/ra144.rs
nihav-realmedia/src/codecs/ra288.rs
nihav-realmedia/src/codecs/ralf.rs
nihav-realmedia/src/codecs/rv10.rs
nihav-realmedia/src/codecs/rv20.rs
nihav-realmedia/src/codecs/rv30.rs
nihav-realmedia/src/codecs/rv40.rs
nihav-realmedia/src/codecs/rv60.rs

index b6929d11a9e7d65714941040dc9d9de75b226007..b899630be52c67dff1d1db2b13ec0f41a8b6e01b 100644 (file)
@@ -561,9 +561,18 @@ pub fn get_decoder_audio() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::test_file_decoding;
+    use crate::codecs::game_register_all_codecs;
+    use crate::demuxers::game_register_all_demuxers;
     #[test]
     fn test_gdv() {
-         test_file_decoding("gdv", "assets/intro1.gdv", Some(10), true, false, None);
+        let mut dmx_reg = RegisteredDemuxers::new();
+        game_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        game_register_all_codecs(&mut dec_reg);
+
+        test_file_decoding("gdv", "assets/intro1.gdv", Some(10), true, false, None, &dmx_reg, &dec_reg);
     }
 }
index f2578621b0b76c2d251b3aabb24d8864c6b5bc0b..901d0e408b5d219cd246b908472ca29cba9e88fd 100644 (file)
@@ -8,6 +8,9 @@ edition = "2018"
 path = "../nihav-core"
 features = ["h263", "fft", "dsp_window"]
 
+[dev-dependencies]
+nihav_commonfmt = { path = "../nihav-commonfmt" }
+
 [features]
 default = ["all_decoders"]
 
index 5840846e9ef81b1643e1fb0960b48f75d21bd227..a48e43efdb2cbbad41bca7cb3a3ed7a2cff81ed5 100644 (file)
@@ -1109,15 +1109,24 @@ const IMC_CB_SELECTOR: [[usize; BANDS]; 4] = [
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::*;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::indeo_register_all_codecs;
+    use nihav_commonfmt::demuxers::generic_register_all_demuxers;
     #[test]
     fn test_imc() {
+        let mut dmx_reg = RegisteredDemuxers::new();
+        generic_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        indeo_register_all_codecs(&mut dec_reg);
+
 //        let file = "assets/neal73_saber.avi";
 //        let file = "assets/IMC/hvalen.avi";
         let file = "assets/IMC/8khz.avi";
 //        let file = "assets/STsKlassFist-1a.avi";
 //        let file = "assets/IMC/Angel Bday.avi";
-        test_decode_audio("avi", file, None, "imc");
+        test_decode_audio("avi", file, None, "imc", &dmx_reg, &dec_reg);
         //test_file_decoding("avi", file, None, false, true, None);
     }
 }
index ffd36c608103e79a15ca3df69a8f2f28f9cc9a8f..a218625035b4e9996afd5417a37fe8ec4de76c91 100644 (file)
@@ -370,9 +370,18 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::indeo_register_all_codecs;
+    use nihav_commonfmt::demuxers::generic_register_all_demuxers;
     #[test]
     fn test_indeo2() {
-         test_file_decoding("avi", "assets/laser05.avi", Some(10), true, false, None);
+        let mut dmx_reg = RegisteredDemuxers::new();
+        generic_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        indeo_register_all_codecs(&mut dec_reg);
+
+        test_file_decoding("avi", "assets/laser05.avi", Some(10), true, false, None, &dmx_reg, &dec_reg);
     }
 }
index e17c1184867e6ed4eaa32f2963c23f95c3f58478..793ef630a0c275affd71049c2e39520cebea1719 100644 (file)
@@ -786,10 +786,19 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::indeo_register_all_codecs;
+    use nihav_commonfmt::demuxers::generic_register_all_demuxers;
     #[test]
     fn test_indeo3() {
-         test_file_decoding("avi", "assets/iv32_example.avi", Some(10), true, false, None);
+        let mut dmx_reg = RegisteredDemuxers::new();
+        generic_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        indeo_register_all_codecs(&mut dec_reg);
+
+        test_file_decoding("avi", "assets/iv32_example.avi", Some(10), true, false, None, &dmx_reg, &dec_reg);
     }
 }
 
index 58c246ecd5f768697eadcd4398b6c19fb2dfda5c..c1e69022b4cc9bee95d16b5404d5e4e613b2e4fc 100644 (file)
@@ -766,10 +766,19 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::indeo_register_all_codecs;
+    use nihav_commonfmt::demuxers::generic_register_all_demuxers;
     #[test]
     fn test_indeo4() {
-         test_file_decoding("avi", "assets/IV4/volcano.avi", /*None*/Some(16), true, false, None/*Some("iv4")*/);
+        let mut dmx_reg = RegisteredDemuxers::new();
+        generic_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        indeo_register_all_codecs(&mut dec_reg);
+
+        test_file_decoding("avi", "assets/IV4/volcano.avi", /*None*/Some(16), true, false, None/*Some("iv4")*/, &dmx_reg, &dec_reg);
 //panic!("the end");
     }
 }
index 5256fa424ee13c6d6e1393cb7bf6f3d12ca21a10..0e67ecf1600bec80ce23dc2ef6bfb4351af9fc9c 100644 (file)
@@ -719,10 +719,19 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::indeo_register_all_codecs;
+    use nihav_commonfmt::demuxers::generic_register_all_demuxers;
     #[test]
     fn test_indeo5() {
-         test_file_decoding("avi", "assets/IV5/sample.avi", /*None*/Some(2), true, false, None);
+        let mut dmx_reg = RegisteredDemuxers::new();
+        generic_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        indeo_register_all_codecs(&mut dec_reg);
+
+        test_file_decoding("avi", "assets/IV5/sample.avi", /*None*/Some(2), true, false, None, &dmx_reg, &dec_reg);
 //         test_file_decoding("avi", "assets/IV5/W32mdl_1.avi", None/*Some(2)*/, true, false, Some("iv5"));
 //panic!("the end");
     }
index df9b85235300e6d4b0fec25e1070689120d76e26..2a837a162e952725f5fb1ee025e7baca6f404efe 100644 (file)
@@ -415,9 +415,18 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::indeo_register_all_codecs;
+    use nihav_commonfmt::demuxers::generic_register_all_demuxers;
     #[test]
     fn test_intel263() {
-         test_file_decoding("avi", "assets/neal73_saber.avi", Some(16), true, false, None/*Some("i263")*/);
+        let mut dmx_reg = RegisteredDemuxers::new();
+        generic_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        indeo_register_all_codecs(&mut dec_reg);
+
+        test_file_decoding("avi", "assets/neal73_saber.avi", Some(16), true, false, None/*Some("i263")*/, &dmx_reg, &dec_reg);
     }
 }
index adda3bf8f9034dc9130441ff77b1a2f57f6764c3..ccc359580e9d2da133c0e0a30876df6dbcffa7b4 100644 (file)
@@ -1,3 +1,6 @@
 extern crate nihav_core;
 
 pub mod codecs;
+
+#[cfg(test)]
+extern crate nihav_commonfmt;
\ No newline at end of file
index de7ac54069da3be4453318deddb5a0b1d60f9f5a..5f61d2e48a2656b756149b3013cb9fedb7b2f8c2 100644 (file)
@@ -680,12 +680,21 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::*;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::realmedia_register_all_codecs;
+    use crate::demuxers::realmedia_register_all_demuxers;
     #[test]
     fn test_cook() {
+        let mut dmx_reg = RegisteredDemuxers::new();
+        realmedia_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        realmedia_register_all_codecs(&mut dec_reg);
+
 //        let file = "assets/RV/rv30_weighted_mc.rm";
         let file = "assets/RV/multichannel.rma";
-        test_decode_audio("realmedia", file, Some(2000), "cook");
+        test_decode_audio("realmedia", file, Some(2000), "cook", &dmx_reg, &dec_reg);
     }
 }
 
index 45e98ebc92464b51767338f91f20bd9c88f6a99b..23e32f2aa5c4e4133f38392ebe1565b369500b41 100644 (file)
@@ -317,11 +317,20 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::*;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::realmedia_register_all_codecs;
+    use crate::demuxers::realmedia_register_all_demuxers;
     #[test]
     fn test_ra144() {
+        let mut dmx_reg = RegisteredDemuxers::new();
+        realmedia_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        realmedia_register_all_codecs(&mut dec_reg);
+
         let file = "assets/RV/ra3_in_rm_file.rm";
-        test_decode_audio("realmedia", file, Some(5000), "ra14.4");
+        test_decode_audio("realmedia", file, Some(5000), "ra14.4", &dmx_reg, &dec_reg);
     }
 }
 
index 3d9b51ba340689fa3e4e3e89ccac244f16ffc430..00e0bd680b1056400b2cfa6a8b0abf2d297aefb7 100644 (file)
@@ -207,11 +207,20 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::*;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::realmedia_register_all_codecs;
+    use crate::demuxers::realmedia_register_all_demuxers;
     #[test]
     fn test_ra288() {
+        let mut dmx_reg = RegisteredDemuxers::new();
+        realmedia_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        realmedia_register_all_codecs(&mut dec_reg);
+
         let file = "assets/RV/A0000044.rm";
-        test_decode_audio("realmedia", file, Some(5000), "ra28.8");
+        test_decode_audio("realmedia", file, Some(5000), "ra28.8", &dmx_reg, &dec_reg);
     }
 }
 
index f65eaeaff0254536ad1df2421902981582825e9f..e114dd0ea67cbe9fb16e60391520eadcc3556bff 100644 (file)
@@ -477,11 +477,20 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::*;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::realmedia_register_all_codecs;
+    use crate::demuxers::realmedia_register_all_demuxers;
     #[test]
     fn test_ralf() {
+        let mut dmx_reg = RegisteredDemuxers::new();
+        realmedia_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        realmedia_register_all_codecs(&mut dec_reg);
+
         let file = "assets/RV/rv40_ralf.rmvb";
-        test_decode_audio("realmedia", file, Some(2000), "ralf");
+        test_decode_audio("realmedia", file, Some(2000), "ralf", &dmx_reg, &dec_reg);
 //panic!("end");
     }
 }
index 3e21315f349d5141d886a2e6ad7fa2d42917a1e2..348a7ff8b713c80255593e9dc9571bb830344135 100644 (file)
@@ -460,10 +460,19 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::realmedia_register_all_codecs;
+    use crate::demuxers::realmedia_register_all_demuxers;
     #[test]
     fn test_rv10() {
-         test_file_decoding("realmedia", "assets/RV/rv10_dnet_640x352_realvideo_encoder_4.0.rm", Some(1000), true, false, None/*Some("rv10")*/);
+        let mut dmx_reg = RegisteredDemuxers::new();
+        realmedia_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        realmedia_register_all_codecs(&mut dec_reg);
+
+        test_file_decoding("realmedia", "assets/RV/rv10_dnet_640x352_realvideo_encoder_4.0.rm", Some(1000), true, false, None/*Some("rv10")*/, &dmx_reg, &dec_reg);
     }
 }
 
index d839840c4adfeb56476074dcf2c72c4895516e66..eeb56cfb9b2f59625e52968ddd6f86e2837e3070 100644 (file)
@@ -524,10 +524,19 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::realmedia_register_all_codecs;
+    use crate::demuxers::realmedia_register_all_demuxers;
     #[test]
     fn test_rv20() {
-        test_file_decoding("realmedia", "assets/RV/rv20_svt_atrc_640x352_realproducer_plus_8.51.rm", /*None*/Some(3000), true, false, None/*Some("rv20")*/);
+        let mut dmx_reg = RegisteredDemuxers::new();
+        realmedia_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        realmedia_register_all_codecs(&mut dec_reg);
+
+        test_file_decoding("realmedia", "assets/RV/rv20_svt_atrc_640x352_realproducer_plus_8.51.rm", /*None*/Some(3000), true, false, None/*Some("rv20")*/, &dmx_reg, &dec_reg);
 //        test_file_decoding("realmedia", "assets/RV/rv20_cook_640x352_realproducer_plus_8.51.rm", /*None*/Some(1000), true, false, Some("rv20"));
     }
 }
index 348209099444514646fbb611a1fe7c08e77e18e7..acdefb61928aaf3086c518a05c2321770f74a2c2 100644 (file)
@@ -165,11 +165,20 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::realmedia_register_all_codecs;
+    use crate::demuxers::realmedia_register_all_demuxers;
     #[test]
     fn test_rv30() {
+        let mut dmx_reg = RegisteredDemuxers::new();
+        realmedia_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        realmedia_register_all_codecs(&mut dec_reg);
+
 //         test_file_decoding("realmedia", "assets/RV/rv30_chroma_drift.rm", Some(1000), true, false, /*None*/Some("rv30"));
-         test_file_decoding("realmedia", "assets/RV/rv30_weighted_mc.rm", Some(400), true, false, None/*Some("rv30")*/);
+        test_file_decoding("realmedia", "assets/RV/rv30_weighted_mc.rm", Some(400), true, false, None/*Some("rv30")*/, &dmx_reg, &dec_reg);
 //         test_file_decoding("realmedia", "assets/RV/simpsons-clip.rm", Some(1337)/*Some(6666)*/, true, false, /*None*/Some("rv30"));
 //panic!("end");
     }
index 542b644006be82ff1511e987e8714cca952e9a7d..d664dce8d343f9867e40b0bb6925ef646e3fc017 100644 (file)
@@ -358,11 +358,20 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::realmedia_register_all_codecs;
+    use crate::demuxers::realmedia_register_all_demuxers;
     #[test]
     fn test_rv40() {
+        let mut dmx_reg = RegisteredDemuxers::new();
+        realmedia_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        realmedia_register_all_codecs(&mut dec_reg);
+
 //         test_file_decoding("realmedia", "assets/RV/rv40_ralf.rmvb", Some(1000), true, false, /*None*/Some("rv40"));
-         test_file_decoding("realmedia", "assets/RV/rv40_weighted_mc.rmvb", Some(400), true, false, None/*Some("rv40")*/);
+        test_file_decoding("realmedia", "assets/RV/rv40_weighted_mc.rmvb", Some(400), true, false, None/*Some("rv40")*/, &dmx_reg, &dec_reg);
 //         test_file_decoding("realmedia", "assets/RV/rv40_weighted_mc_2.rmvb", Some(1000), true, false, /*None*/Some("rv40"));
 //panic!("end");
     }
index 20a0f7ac92b2e4cd3c930d1d73d6e7096908ba17..a076d870147a35fa134d935fb180f493111edd5c 100644 (file)
@@ -1481,10 +1481,19 @@ pub fn get_decoder() -> Box<NADecoder> {
 
 #[cfg(test)]
 mod test {
-    use crate::test::dec_video::test_file_decoding;
+    use nihav_core::codecs::RegisteredDecoders;
+    use nihav_core::demuxers::RegisteredDemuxers;
+    use nihav_core::test::dec_video::*;
+    use crate::codecs::realmedia_register_all_codecs;
+    use crate::demuxers::realmedia_register_all_demuxers;
     #[test]
     fn test_rv60() {
-         test_file_decoding("realmedia", "assets/RV/RV60.rmhd", Some(4000), true, false, None/*Some("rv60")*/);
+        let mut dmx_reg = RegisteredDemuxers::new();
+        realmedia_register_all_demuxers(&mut dmx_reg);
+        let mut dec_reg = RegisteredDecoders::new();
+        realmedia_register_all_codecs(&mut dec_reg);
+
+        test_file_decoding("realmedia", "assets/RV/RV60.rmhd", Some(4000), true, false, None/*Some("rv60")*/, &dmx_reg, &dec_reg);
 //panic!("end");
     }
 }