diff --git a/tests/codec.rs b/tests/codec.rs index 6828d6a..4e6383d 100644 --- a/tests/codec.rs +++ b/tests/codec.rs @@ -20,8 +20,13 @@ impl From for TestError { } #[test] -fn main() -> Result<(), DecodeError> { - let file = File::open("qoi_test_images/dice.qoi").unwrap(); +/// There are test images provided by the QOI spec author: https://qoiformat.org/qoi_test_images.zip +/// This function looks for them in `./qoi_test_images/` and turns them all +/// into PNGs. Manual inspection is required to evaluate the test result. +fn decode_qoi_samples() -> Result<(), TestError> { + let file = File::open("qoi_test_images/dice.qoi").map_err(|_io_err| TestError::SetupFailure)?; + + // TODO: feed the Result<> forward, don't let a panic path be given to an unaware caller. let mut bytes = file.bytes() .map(|maybe_bytes| {