From 657034eaef6797b5aeb8a1beb311a84c65e6f314 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Fri, 11 Jul 2014 01:03:54 +0400 Subject: [PATCH] huge_test: turn GC_WORD_MAX into a signed constant * tests/huge_test.c (GC_IGNORE_WARN): Refine comment. * tests/huge_test.c (GC_WORD_MAX): Replace with GC_SWORD_MAX; change type to GC_signed_word. --- tests/huge_test.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/huge_test.c b/tests/huge_test.c index d1d71630..c2450202 100644 --- a/tests/huge_test.c +++ b/tests/huge_test.c @@ -5,8 +5,8 @@ #ifndef GC_IGNORE_WARN /* Ignore misleading "Out of Memory!" warning (which is printed on */ - /* every GC_MALLOC(LONG_MAX) call) by defining this macro before */ - /* "gc.h" inclusion. */ + /* every GC_MALLOC call below) by defining this macro before "gc.h" */ + /* inclusion. */ # define GC_IGNORE_WARN #endif @@ -19,7 +19,7 @@ * expected manner. */ -#define GC_WORD_MAX (((GC_word)-1) >> 1) +#define GC_SWORD_MAX ((GC_signed_word)(((GC_word)-1) >> 1)) int main(void) { @@ -31,22 +31,22 @@ int main(void) /* That's OK. We test this corner case mostly to make sure that */ /* it fails predictably. */ GC_expand_hp(1024*1024*5); - r = GC_MALLOC(GC_WORD_MAX - 1024); + r = GC_MALLOC(GC_SWORD_MAX - 1024); if (NULL != r) { fprintf(stderr, - "Size GC_WORD_MAX-1024 allocation unexpectedly succeeded\n"); + "Size SWORD_MAX-1024 allocation unexpectedly succeeded\n"); exit(1); } - r = GC_MALLOC(GC_WORD_MAX); + r = GC_MALLOC(GC_SWORD_MAX); if (NULL != r) { fprintf(stderr, - "Size GC_WORD_MAX allocation unexpectedly succeeded\n"); + "Size SWORD_MAX allocation unexpectedly succeeded\n"); exit(1); } - r = GC_MALLOC(GC_WORD_MAX + 1024); + r = GC_MALLOC((GC_word)GC_SWORD_MAX + 1024); if (NULL != r) { fprintf(stderr, - "Size GC_WORD_MAX+1024 allocation unexpectedly succeeded\n"); + "Size SWORD_MAX+1024 allocation unexpectedly succeeded\n"); exit(1); } return 0; -- 2.40.0