summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorivmai <ivmai>2011-04-02 10:15:06 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:57 +0200
commitc722dc23c07dc73f0a3f73d5f54d9b39a25bea2d (patch)
tree7940138eab0759dd0841085f7de0cfdfbcba8987 /tests
parentbfda2d071b53ba9cafff211434812821d969c29d (diff)
2011-04-02 Ivan Maidanski <ivmai@mail.ru>
* tests/test.c (reverse_test_inner): Test interior pointer recognition only if ALL_INTERIOR_POINTERS. * tests/test.c (run_one_test): Replace GC_all_interior_pointers with GC_get_all_interior_pointers(); simplify the expression. * tests/test.c (check_heap_stats): Replace GC_bytes_allocd and GC_bytes_allocd_before_gc with GC_get_total_bytes(). * tests/test.c (main): Replace GC_gc_no with GC_get_gc_no().
Diffstat (limited to 'tests')
-rw-r--r--tests/test.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/test.c b/tests/test.c
index d8cf4f6..c271073 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -588,9 +588,11 @@ void *GC_CALLBACK reverse_test_inner(void *data)
for (i = 0; i < 10; i++) {
(void)ints(1, BIG);
}
- /* Superficially test interior pointer recognition on stack */
+# ifdef ALL_INTERIOR_POINTERS
+ /* Superficially test interior pointer recognition on stack */
c = (sexpr)((char *)c + sizeof(char *));
d = (sexpr)((char *)d + sizeof(char *));
+# endif
GC_FREE((void *)e);
@@ -1143,8 +1145,7 @@ void run_one_test(void)
# if defined(RS6000) || defined(POWERPC)
if (!TEST_FAIL_COUNT(1))
# else
- if ((GC_all_interior_pointers && !TEST_FAIL_COUNT(1))
- || (!GC_all_interior_pointers && !TEST_FAIL_COUNT(2)))
+ if (!TEST_FAIL_COUNT(GC_get_all_interior_pointers() ? 1 : 2))
# endif
{
GC_printf("GC_is_valid_displacement produced wrong failure indication\n");
@@ -1326,11 +1327,10 @@ void check_heap_stats(void)
}
}
(void)GC_printf("Total number of bytes allocated is %lu\n",
- (unsigned long)
- (GC_bytes_allocd + GC_bytes_allocd_before_gc));
+ (unsigned long)GC_get_total_bytes());
(void)GC_printf("Final heap size is %lu bytes\n",
(unsigned long)GC_get_heap_size());
- if (GC_bytes_allocd + GC_bytes_allocd_before_gc < n_tests *
+ if (GC_get_total_bytes() < n_tests *
# ifdef VERY_SMALL_CONFIG
2700000
# else
@@ -1703,7 +1703,7 @@ int main(void)
check_heap_stats();
(void)fflush(stdout);
pthread_attr_destroy(&attr);
- GC_printf("Completed %u collections\n", (unsigned)GC_gc_no);
+ GC_printf("Completed %u collections\n", (unsigned)GC_get_gc_no());
# ifdef PTW32_STATIC_LIB
pthread_win32_thread_detach_np ();
pthread_win32_process_detach_np ();