]> granicus.if.org Git - gc/commitdiff
Fix missing atomic_count and realloc_count incrementation in gctest
authorIvan Maidanski <ivmai@mail.ru>
Sun, 8 Oct 2017 10:09:46 +0000 (13:09 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 8 Oct 2017 10:09:46 +0000 (13:09 +0300)
* tests/test.c [!AT_END && !THREADS] (reverse_test_inner): Increment
realloc_count after GC_REALLOC() call.
* tests/test.c (run_one_test): Increment atomic_count after
(void)GC_MALLOC_ATOMIC(0) and GC_malloc_atomic(1) calls.

tests/test.c

index 3a728e0e4c3f0de8e00715249c732494d821800b..d6e99c40216bb2220067d13b185ca68676de3d5b 100644 (file)
@@ -737,6 +737,7 @@ void *GC_CALLBACK reverse_test_inner(void *data)
           } else {
             a = (sexpr)GC_REALLOC((void *)a, 8200);
           }
+          realloc_count++;
 #       endif
     }
     check_ints(a,1,49);
@@ -1406,8 +1407,10 @@ void run_one_test(void)
              AO_fetch_and_add1(&collectable_count);
              GC_FREE(GC_MALLOC(0));
              (void)GC_MALLOC_ATOMIC(0);
+             atomic_count++;
              GC_FREE(GC_MALLOC_ATOMIC(0));
              test_generic_malloc_or_special(GC_malloc_atomic(1));
+             atomic_count++;
            }
          }
 #   ifdef GC_GCJ_SUPPORT