Add PUFFS_VERSION.

This commit is contained in:
Nigel Tao committed 2017-05-27 09:59:55 +10:00
1 parent cc9aeb63c1
commit a9bb43229a
6 files changed
+101 -20

No files matched your search

+19 -4
View File
@@ -20,15 +20,30 @@ const char* test_filename = "gif/basic.c";
void test_default_literal_width() {
puffs_gif_lzw_decoder dec;
puffs_gif_lzw_decoder_constructor(&dec);
puffs_gif_lzw_decoder_constructor(&dec, PUFFS_VERSION);
if (dec.f_literal_width != 0) {
FAIL("test_default_literal_width: got %d, want %d", dec.f_literal_width, 0);
puffs_gif_lzw_decoder_destructor(&dec);
return;
goto cleanup0;
}
cleanup0:
puffs_gif_lzw_decoder_destructor(&dec);
}
void test_puffs_version_bad() {
puffs_gif_lzw_decoder dec;
puffs_gif_lzw_decoder_constructor(&dec, 0); // 0 is not PUFFS_VERSION.
if (dec.status != puffs_gif_error_bad_version) {
FAIL("test_puffs_version_bad: got %d, want %d", dec.status,
puffs_gif_error_bad_version);
goto cleanup0;
}
cleanup0:
puffs_gif_lzw_decoder_destructor(&dec);
}
// The empty comments forces clang-format to place one element per line.
test tests[] = {
test_default_literal_width, NULL,
test_default_literal_width, //
test_puffs_version_bad, //
NULL, //
};