extra tests for other unsupported png scenarios
This commit is contained in:
parent
76d0289a0f
commit
d02b81b1fb
|
@ -638,6 +638,38 @@ pub mod tests {
|
||||||
Err(PngError::BadFile(..))
|
Err(PngError::BadFile(..))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
assert_matches!(
|
||||||
|
IndexedBitmap::load_png_file(path_to_file(Path::new("unsupported_alpha_8bit.png")).as_path()),
|
||||||
|
Err(PngError::BadFile(..))
|
||||||
|
);
|
||||||
|
assert_matches!(
|
||||||
|
IndexedBitmap::load_png_file(path_to_file(Path::new("unsupported_greyscale_8bit.png")).as_path()),
|
||||||
|
Err(PngError::BadFile(..))
|
||||||
|
);
|
||||||
|
assert_matches!(
|
||||||
|
IndexedBitmap::load_png_file(path_to_file(Path::new("unsupported_indexed_16col.png")).as_path()),
|
||||||
|
Err(PngError::BadFile(..))
|
||||||
|
);
|
||||||
|
assert_matches!(
|
||||||
|
IndexedBitmap::load_png_file(path_to_file(Path::new("unsupported_rgb_16bit.png")).as_path()),
|
||||||
|
Err(PngError::BadFile(..))
|
||||||
|
);
|
||||||
|
assert_matches!(
|
||||||
|
IndexedBitmap::load_png_file(path_to_file(Path::new("unsupported_rgba_16bit.png")).as_path()),
|
||||||
|
Err(PngError::BadFile(..))
|
||||||
|
);
|
||||||
|
|
||||||
|
// also test the extra formats that IndexedBitmap does not support which RgbaBitmap does
|
||||||
|
// (anything not 256-color indexed basically ...)
|
||||||
|
assert_matches!(
|
||||||
|
IndexedBitmap::load_png_file(path_to_file(Path::new("rgb.png")).as_path()),
|
||||||
|
Err(PngError::BadFile(..))
|
||||||
|
);
|
||||||
|
assert_matches!(
|
||||||
|
IndexedBitmap::load_png_file(path_to_file(Path::new("rgba.png")).as_path()),
|
||||||
|
Err(PngError::BadFile(..))
|
||||||
|
);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue