Test for constructor not called.

This commit is contained in:
Nigel Tao committed 2017-05-28 10:50:26 +10:00
1 parent aa46c5479e
commit 1db9602294
4 files changed
+45 -13

No files matched your search

+10 -2
View File
@@ -39,8 +39,9 @@ typedef enum {
puffs_gif_status_ok = 0,
puffs_gif_error_bad_version = -2 + 1,
puffs_gif_error_null_receiver = -4 + 1,
puffs_gif_status_short_dst = -6,
puffs_gif_status_short_src = -8,
puffs_gif_error_constructor_not_called = -6 + 1,
puffs_gif_status_short_dst = -8,
puffs_gif_status_short_src = -10,
} puffs_gif_status;
// ---------------- Public Structs
@@ -113,5 +114,12 @@ puffs_gif_status puffs_gif_lzw_decoder_decode(puffs_gif_lzw_decoder* self) {
if (status & 1) {
return status;
}
if (self->magic != PUFFS_MAGIC) {
status = puffs_gif_error_constructor_not_called;
goto cleanup0;
}
cleanup0:
self->status = status;
return status;
}
+3 -2
View File
@@ -39,8 +39,9 @@ typedef enum {
puffs_gif_status_ok = 0,
puffs_gif_error_bad_version = -2 + 1,
puffs_gif_error_null_receiver = -4 + 1,
puffs_gif_status_short_dst = -6,
puffs_gif_status_short_src = -8,
puffs_gif_error_constructor_not_called = -6 + 1,
puffs_gif_status_short_dst = -8,
puffs_gif_status_short_src = -10,
} puffs_gif_status;
// ---------------- Public Structs