From: Ivan Maidanski Date: Tue, 10 Apr 2012 04:38:22 +0000 (+0400) Subject: Improve disclaim_test to detect bug in fnlz_mlc X-Git-Tag: gc7_3alpha2~24^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f63e95f14c6e57c0e98db3e9264dcdd077fdf857;p=gc Improve disclaim_test to detect bug in fnlz_mlc * tests/disclaim_test.c (misc_sizes_dct): Add "log_size" local variable (used for "size" evaluation); add assertion on "log_size" value. --- diff --git a/tests/disclaim_test.c b/tests/disclaim_test.c index f9133ae2..11eb17ec 100644 --- a/tests/disclaim_test.c +++ b/tests/disclaim_test.c @@ -40,8 +40,12 @@ int memeq(void *s, int c, size_t len) void GC_CALLBACK misc_sizes_dct(void *obj, void *cd) { - size_t size = (size_t)1 << *(unsigned char *)obj; + unsigned log_size = *(unsigned char *)obj; + size_t size; + + my_assert(log_size < sizeof(size_t) * 8); my_assert(cd == NULL); + size = (size_t)1 << log_size; my_assert(memeq((char *)obj + 1, 0x56, size - 1)); }