Check the Exif block contents in truncation tests.

This commit is contained in:
KAMADA Ken'ichi 2020-12-08 19:35:57 +09:00
parent a406139859
commit ef78b2241b
2 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ mod tests {
}
let mut data = b"\xff\xd8\xff\xe1\x00\x08Exif\0\0".to_vec();
get_exif_attr(&mut &data[..]).unwrap();
assert_eq!(get_exif_attr(&mut &data[..]).unwrap(), b"");
while let Some(_) = data.pop() {
get_exif_attr(&mut &data[..]).unwrap_err();
}

View File

@ -102,7 +102,7 @@ mod tests {
}
let mut data = b"\x89PNG\x0d\x0a\x1a\x0a\0\0\0\x04eXIfExif".to_vec();
get_exif_attr(&mut &data[..]).unwrap();
assert_eq!(get_exif_attr(&mut &data[..]).unwrap(), b"Exif");
while let Some(_) = data.pop() {
get_exif_attr(&mut &data[..]).unwrap_err();
}