diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2012-11-18 12:32:34 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-11-18 12:32:34 +0400 |
commit | 80a6d6a14af35d119f738126e71f4464ea76a8ea (patch) | |
tree | bcc004d49529e253769b5bf1040fc13380141dd3 | |
parent | 1d94cc7c3a7b55dcaeb1808cc88b8c753d608446 (diff) | |
download | bdwgc-80a6d6a14af35d119f738126e71f4464ea76a8ea.tar.gz |
Enable huge_test for Win64 (and LLP64 target)
* tests/huge_test.c (GC_WORD_MAX): New macro
* tests/huge_test.c (main): Do not check for long has the same size as
pointer; use unsigned GC_WORD_MAX instead of LONG_MAX; use NULL
instead of 0 for pointers.
-rw-r--r-- | tests/huge_test.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/tests/huge_test.c b/tests/huge_test.c index dd58a8e7..d1d71630 100644 --- a/tests/huge_test.c +++ b/tests/huge_test.c @@ -19,8 +19,11 @@ * expected manner. */ +#define GC_WORD_MAX (((GC_word)-1) >> 1) + int main(void) { + void *r; GC_INIT(); GC_set_max_heap_size(100*1024*1024); @@ -28,26 +31,23 @@ 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); -// if (sizeof(long) == sizeof(void *)) - { - void *r = GC_MALLOC(LONG_MAX-1024); - if (0 != r) { - fprintf(stderr, - "Size LONG_MAX-1024 allocation unexpectedly succeeded\n"); - exit(1); - } - r = GC_MALLOC(LONG_MAX); - if (0 != r) { - fprintf(stderr, - "Size LONG_MAX allocation unexpectedly succeeded\n"); - exit(1); - } - r = GC_MALLOC((size_t)LONG_MAX + 1024); - if (0 != r) { - fprintf(stderr, - "Size LONG_MAX+1024 allocation unexpectedly succeeded\n"); - exit(1); - } + r = GC_MALLOC(GC_WORD_MAX - 1024); + if (NULL != r) { + fprintf(stderr, + "Size GC_WORD_MAX-1024 allocation unexpectedly succeeded\n"); + exit(1); + } + r = GC_MALLOC(GC_WORD_MAX); + if (NULL != r) { + fprintf(stderr, + "Size GC_WORD_MAX allocation unexpectedly succeeded\n"); + exit(1); + } + r = GC_MALLOC(GC_WORD_MAX + 1024); + if (NULL != r) { + fprintf(stderr, + "Size GC_WORD_MAX+1024 allocation unexpectedly succeeded\n"); + exit(1); } return 0; } |