From 27ad58cb112f0e388d1afe40b6d0f9651f2dabd5 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 21 Jun 2017 00:42:44 +0300 Subject: [PATCH] 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). --- tests/test.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/test.c b/tests/test.c index 42236418..5c348851 100644 --- a/tests/test.c +++ b/tests/test.c @@ -1105,11 +1105,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( @@ -1123,6 +1123,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++; -- 2.40.0