Test that end_of_data is repeatedly returned

This commit is contained in:
Nigel Tao committed 2018-08-26 22:42:42 +10:00
1 parent d4f7c263e3
commit 54e5ea7f15
1 file changed
+10 -7
+10 -7
View File
@@ -552,13 +552,16 @@ bool do_test_wuffs_gif_decode_animated(
}
}
// There should be no more frames.
z = wuffs_gif__decoder__decode_frame(&dec, &pb, 0, 0, src_reader,
((wuffs_base__slice_u8){}));
if (z != wuffs_base__suspension__end_of_data) {
FAIL("decode_frame: got \"%s\", want \"%s\"", z,
wuffs_base__suspension__end_of_data);
return false;
// There should be no more frames, no matter how many times we call
// decode_frame.
for (i = 0; i < 3; i++) {
z = wuffs_gif__decoder__decode_frame(&dec, &pb, 0, 0, src_reader,
((wuffs_base__slice_u8){}));
if (z != wuffs_base__suspension__end_of_data) {
FAIL("decode_frame: got \"%s\", want \"%s\"", z,
wuffs_base__suspension__end_of_data);
return false;
}
}
uint64_t got_num_frames = wuffs_gif__decoder__num_decoded_frames(&dec);