X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-codec-support%2Fsrc%2Ftest%2Fmod.rs;fp=nihav-codec-support%2Fsrc%2Ftest%2Fmod.rs;h=367be24adf02d4258f166a19203a432f1dfe3416;hb=b4d5b8515e75383b4fc59ea2813c90c615d59a96;hp=0000000000000000000000000000000000000000;hpb=2b8bf9a03242bbd6e80091082a50ec13b1a95143;p=nihav.git diff --git a/nihav-codec-support/src/test/mod.rs b/nihav-codec-support/src/test/mod.rs new file mode 100644 index 0000000..367be24 --- /dev/null +++ b/nihav-codec-support/src/test/mod.rs @@ -0,0 +1,21 @@ +//! Decoder testing functionality. +//! +//! This module provides functions that may be used in internal test to check that decoders produce output and that they produce expected output. +pub mod dec_video; +pub mod wavwriter; + +mod md5; // for internal checksums only + +/// Decoder testing modes. +/// +/// NihAV has its own MD5 hasher that calculates hash for input frame in a deterministic way (i.e. no endianness issues) and it outputs hash as `[u32; 4]`. During testing the resulting hash will be printed out so when the test fails you can find what was the calculated hash (and use it as a reference if you are implementing a new test). +pub enum ExpectedTestResult { + /// Decoding runs without errors. + Decodes, + /// Full decoded output is expected to be equal to this MD5 hash. + MD5([u32; 4]), + /// Each decoded frame hash should be equal to the corresponding MD5 hash. + MD5Frames(Vec<[u32; 4]>), + /// Test function should report decoded frame hashes to be used as the reference later. + GenerateMD5Frames, +}