Check the Exif block contents in truncation tests.
This commit is contained in:
parent
a406139859
commit
ef78b2241b
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue