]>
Commit | Line | Data |
---|---|---|
fb8e3177 KS |
1 | //! Decoder testing functionality. |
2 | //! | |
3 | //! This module provides functions that may be used in internal test to check that decoders produce output and that they produce expected output. | |
03011b99 | 4 | #[allow(clippy::identity_op)] |
379fd781 | 5 | pub mod dec_video; |
0b257d9f | 6 | pub mod enc_video; |
cc0859d6 | 7 | pub mod wavwriter; |
eca0802b | 8 | |
03011b99 KS |
9 | #[allow(clippy::identity_op)] |
10 | #[allow(clippy::unreadable_literal)] | |
eca0802b KS |
11 | mod md5; // for internal checksums only |
12 | ||
fb8e3177 KS |
13 | /// Decoder testing modes. |
14 | /// | |
15 | /// 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). | |
eca0802b | 16 | pub enum ExpectedTestResult { |
fb8e3177 | 17 | /// Decoding runs without errors. |
eca0802b | 18 | Decodes, |
fb8e3177 | 19 | /// Full decoded output is expected to be equal to this MD5 hash. |
eca0802b | 20 | MD5([u32; 4]), |
fb8e3177 | 21 | /// Each decoded frame hash should be equal to the corresponding MD5 hash. |
eca0802b | 22 | MD5Frames(Vec<[u32; 4]>), |
fb8e3177 | 23 | /// Test function should report decoded frame hashes to be used as the reference later. |
eca0802b KS |
24 | GenerateMD5Frames, |
25 | } |