From: Ivan Maidanski Date: Tue, 20 Jun 2017 21:42:44 +0000 (+0300) Subject: Add minimal testing of GC_set_bit (gctest) X-Git-Tag: v7.6.2~124 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3cff26cb3438f72a6ed010ad606b3a59693e39cd;p=gc Add minimal testing of GC_set_bit (gctest) * tests/test.c (typed_test): Initialize bm3, bm2 local variables to zero; call GC_set_bit to setup bm3 and bm2 (instead of direct hard-coding of bm3 and bm2 values during their initialization). --- diff --git a/tests/test.c b/tests/test.c index 7a3834e2..cd2fcecc 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1124,11 +1124,11 @@ const GC_word bm_huge[320 / CPP_WORDSZ] = { void typed_test(void) { GC_word * old, * new; - GC_word bm3[1] = { 0x3 }; - GC_word bm2[1] = { 0x2 }; + GC_word bm3[1] = {0}; + GC_word bm2[1] = {0}; GC_word bm_large[1] = { 0xf7ff7fff }; - GC_descr d1 = GC_make_descriptor(bm3, 2); - GC_descr d2 = GC_make_descriptor(bm2, 2); + GC_descr d1; + GC_descr d2; GC_descr d3 = GC_make_descriptor(bm_large, 32); GC_descr d4 = GC_make_descriptor(bm_huge, 320); GC_word * x = (GC_word *)GC_malloc_explicitly_typed( @@ -1144,6 +1144,11 @@ void typed_test(void) GC_printf("Bad GC_get_bit() or bm_huge initialization\n"); FAIL; } + GC_set_bit(bm3, 0); + GC_set_bit(bm3, 1); + d1 = GC_make_descriptor(bm3, 2); + GC_set_bit(bm2, 1); + d2 = GC_make_descriptor(bm2, 2); old = 0; for (i = 0; i < 4000; i++) { collectable_count++;