Tests/Benches: Fixup for new Picture::new_unchecked signature

Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
Serial 2023-11-30 13:26:50 -05:00 committed by Alex
parent c62ac9e252
commit ec80ae828c
2 changed files with 9 additions and 9 deletions

View file

@ -47,7 +47,7 @@ fn bench_write(c: &mut Criterion) {
let picture = Picture::new_unchecked(
PictureType::CoverFront,
MimeType::Jpeg,
Some(MimeType::Jpeg),
None,
include_bytes!("../benches_assets/cover.jpg").to_vec(),
);
@ -73,7 +73,7 @@ fn bench_write(c: &mut Criterion) {
let picture = Picture::new_unchecked(
PictureType::CoverFront,
MimeType::Jpeg,
Some(MimeType::Jpeg),
None,
include_bytes!("../benches_assets/cover.jpg").to_vec(),
);
@ -97,7 +97,7 @@ fn bench_write(c: &mut Criterion) {
let picture = Picture::new_unchecked(
PictureType::CoverFront,
MimeType::Jpeg,
Some(MimeType::Jpeg),
None,
include_bytes!("../benches_assets/cover.jpg").to_vec(),
);
@ -116,7 +116,7 @@ fn bench_write(c: &mut Criterion) {
let picture = Picture::new_unchecked(
PictureType::CoverFront,
MimeType::Jpeg,
Some(MimeType::Jpeg),
None,
include_bytes!("../benches_assets/cover.jpg").to_vec(),
);

View file

@ -16,7 +16,7 @@ fn get_buf(path: &str) -> Vec<u8> {
fn picture_from_reader_png() {
let pic = Picture::from_reader(&mut &*get_buf("tests/picture/assets/png_640x628.png")).unwrap();
assert_eq!(pic.mime_type(), &MimeType::Png);
assert_eq!(pic.mime_type(), Some(&MimeType::Png));
}
#[test]
@ -24,21 +24,21 @@ fn picture_from_reader_jpeg() {
let pic =
Picture::from_reader(&mut &*get_buf("tests/picture/assets/jpeg_640x628.jpg")).unwrap();
assert_eq!(pic.mime_type(), &MimeType::Jpeg);
assert_eq!(pic.mime_type(), Some(&MimeType::Jpeg));
}
#[test]
fn picture_from_reader_bmp() {
let pic = Picture::from_reader(&mut &*get_buf("tests/picture/assets/bmp_640x628.bmp")).unwrap();
assert_eq!(pic.mime_type(), &MimeType::Bmp);
assert_eq!(pic.mime_type(), Some(&MimeType::Bmp));
}
#[test]
fn picture_from_reader_gif() {
let pic = Picture::from_reader(&mut &*get_buf("tests/picture/assets/gif_640x628.gif")).unwrap();
assert_eq!(pic.mime_type(), &MimeType::Gif);
assert_eq!(pic.mime_type(), Some(&MimeType::Gif));
}
#[test]
@ -46,5 +46,5 @@ fn picture_from_reader_tiff() {
let pic =
Picture::from_reader(&mut &*get_buf("tests/picture/assets/tiff_640x628.tiff")).unwrap();
assert_eq!(pic.mime_type(), &MimeType::Tiff);
assert_eq!(pic.mime_type(), Some(&MimeType::Tiff));
}