]> granicus.if.org Git - gc/commitdiff
Print relevant message in tests not appropriate for leak detection mode
authorIvan Maidanski <ivmai@mail.ru>
Thu, 22 Nov 2018 22:17:28 +0000 (01:17 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 22 Nov 2018 22:17:28 +0000 (01:17 +0300)
* cord/tests/cordtest.c (main): If GC_get_find_leak() then print a
message that the test is not designed for leak detection mode (i.e.,
plenty of leaks could be reported).
* tests/disclaim_bench.c (main): Likewise.
* tests/disclaim_test.c (main): Likewise.
* tests/disclaim_weakmap_test.c (main): Likewise.
* tests/initsecondarythread.c (main): Likewise.
* tests/middle.c (main): Likewise.
* tests/realloc_test.c (main): Likewise.
* tests/staticrootstest.c (main): Likewise.
* tests/test_cpp.cc (main): Likewise.
* tests/threadkey_test.c (main): Likewise.
* tests/trace_test.c (main): Likewise.

cord/tests/cordtest.c
tests/disclaim_bench.c
tests/disclaim_test.c
tests/disclaim_weakmap_test.c
tests/initsecondarythread.c
tests/middle.c
tests/realloc_test.c
tests/staticrootstest.c
tests/test_cpp.cc
tests/threadkey_test.c
tests/trace_test.c

index 73ab82aa7669fc9398f83c55d7979fa6616befbf..f4868fd51d4b2814309fb6e84553a5dc000e1b95 100644 (file)
@@ -312,6 +312,8 @@ int main(void)
 #   ifndef NO_INCREMENTAL
       GC_enable_incremental();
 #   endif
+    if (GC_get_find_leak())
+        printf("This test program is not designed for leak detection mode\n");
     test_basics();
     test_extras();
     test_printf();
index 8be81cf69b951888ffcf06996375ea16daba6935..28feb1a5cff8e1e30ddb2d5421f4b2eecb843a4e 100644 (file)
@@ -121,6 +121,8 @@ int main(int argc, char **argv)
         model_min = 0;
         model_max = 2;
     }
+    if (GC_get_find_leak())
+        printf("This test program is not designed for leak detection mode\n");
 
     keep_arr = (testobj_t *)GC_MALLOC(sizeof(void *) * KEEP_CNT);
     if (NULL == keep_arr) {
index 4febf7f73b04415061c8c2ae7d71df9958d4dcfd..f76f5cedba000ceda31f2cbb2379afcb7662a410 100644 (file)
@@ -241,6 +241,8 @@ int main(void)
 #   ifndef NO_INCREMENTAL
         GC_enable_incremental();
 #   endif
+    if (GC_get_find_leak())
+        printf("This test program is not designed for leak detection mode\n");
 
     test_misc_sizes();
 
index 9f40e452d6f87cabd07cd8038bc1b3c8e6a9f3e5..7fb63a2fd76ac258d2fa942178f5231b3b98edc2 100644 (file)
@@ -432,6 +432,8 @@ int main(void)
 # ifndef NO_INCREMENTAL
     GC_enable_incremental();
 # endif
+  if (GC_get_find_leak())
+    printf("This test program is not designed for leak detection mode\n");
 
   weakobj_free_list = GC_new_free_list();
   CHECK_OOM(weakobj_free_list);
index 788a86252256165a1aa45807a06bdfb887ec84d0..0ad855d8d2e059d22b09dfc72a3e0d9b79587733 100644 (file)
@@ -85,6 +85,8 @@ int main(void)
     GC_INIT();
 # endif
   (void)GC_get_parallel(); /* linking fails if no threads support */
+  if (GC_get_find_leak())
+    printf("This test program is not designed for leak detection mode\n");
 # ifdef GC_PTHREADS
     if ((code = pthread_create (&t, NULL, thread, NULL)) != 0) {
       fprintf(stderr, "Thread creation failed %d\n", code);
index 55686f759ccc334194fafd9484a96eb16a885274..9a7cc3d08ca4bfaf8815800ea6469d39affb8908 100644 (file)
@@ -11,6 +11,8 @@ int main (void)
 
   GC_set_all_interior_pointers(0);
   GC_INIT();
+  if (GC_get_find_leak())
+    printf("This test program is not designed for leak detection mode\n");
 
   for (i = 0; i < 20000; ++i) {
     (void)GC_malloc_atomic(4096);
index c7c80d73873f68d4768b30d815cd12acfc1f16ed..8870971b4bb01467a4dbf1c2388e0c9588944f30 100644 (file)
@@ -10,6 +10,8 @@ int main(void) {
   unsigned long last_heap_size = 0;
 
   GC_INIT();
+  if (GC_get_find_leak())
+    printf("This test program is not designed for leak detection mode\n");
 
   for (i = 0; i < COUNT; i++) {
     int **p = GC_NEW(int *);
index b43765d08ba3b966a713b945f12557db419c9ac9..66aca2997a22fa9e0b3c9ea3d94fff7cde49d251 100644 (file)
@@ -49,6 +49,8 @@ int main(void)
     GC_INIT();
 # endif
   init_staticroot();
+  if (GC_get_find_leak())
+    printf("This test program is not designed for leak detection mode\n");
   if (NULL == staticroot) {
     fprintf(stderr, "GC_malloc returned NULL\n");
     return 2;
index db3de0225798dd601c5845af48f8816cf1288bcb..176b52663c0a9bb301d25ac276cc8b27088a6401 100644 (file)
@@ -309,6 +309,8 @@ void* Undisguise( GC_word i ) {
 #   ifndef NO_INCREMENTAL
       GC_enable_incremental();
 #   endif
+    if (GC_get_find_leak())
+      GC_printf("This test program is not designed for leak detection mode\n");
 
     int i, iters, n;
 #   ifndef DONT_USE_STD_ALLOCATOR
index e348d72485b9e7346dfcdb6c2c6c0ddbd76e8c67..e224aac99ec28f46d332499379bcd656ddab9409 100644 (file)
@@ -87,8 +87,10 @@ void make_key (void)
 int main (void)
 {
   int i;
-  GC_INIT ();
 
+  GC_INIT();
+  if (GC_get_find_leak())
+    printf("This test program is not designed for leak detection mode\n");
 # ifdef GC_SOLARIS_THREADS
     pthread_key_create (&key, on_thread_exit);
 # else
index 726519d0c56227f51db0307c00d0f09e8d8fbfc7..d97bbed150070f923c781c338bb152b55c389b9e 100644 (file)
@@ -39,7 +39,10 @@ struct treenode * mktree(int i) {
 int main(void)
 {
   int i;
+
   GC_INIT();
+  if (GC_get_find_leak())
+    printf("This test program is not designed for leak detection mode\n");
   for (i = 0; i < 10; ++i) {
     root[i] = mktree(12);
   }