summaryrefslogtreecommitdiff
path: root/cord/tests
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-04-22 08:22:04 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-04-22 08:22:04 +0300
commit2470c7047baef8446bd167835dcf656ffffeaeb2 (patch)
tree1660ae844d86913658597110e3a363822abb6473 /cord/tests
parente2fb45fc98276b856e03faf2c3016cd2921b2e2c (diff)
downloadbdwgc-2470c7047baef8446bd167835dcf656ffffeaeb2.tar.gz
Fix linking of tests in case of finalization is off
(fix of commit c14335e44) * cord/cordxtra.c (CORD_lf_close_proc): Do not define if GC_NO_FINALIZATION. * cord/cordxtra.c (CORD_from_file_lazy_inner): Do not call GC_REGISTER_FINALIZER(CORD_lf_close_proc) if GC_NO_FINALIZATION. * cord/tests/cordtest.c (test_extras): Do not call GC_invoke_finalizers if GC_NO_FINALIZATION. * include/gc/gc_cpp.h (gc_cleanup::~gc_cleanup, gc_cleanup::gc_cleanup): Do not call GC_base() and GC_register_finalizer_ignore_self() if GC_NO_FINALIZATION. * include/gc/gc_cpp.h (operator new): Do not call GC_REGISTER_FINALIZER_IGNORE_SELF() if GC_NO_FINALIZATION. * tests/cpp.cc [FINALIZE_ON_DEMAND] (main): Do not call GC_invoke_finalizers() if GC_NO_FINALIZATION. * tests/disclaim_bench.c (testobj_new): Do not call GC_NEW() followed by GC_REGISTER_FINALIZER_NO_ORDER() if GC_NO_FINALIZATION. * tests/disclaim_bench.c [GC_NO_FINALIZATION] (main): Set model_min variable to 1 (instead of 0). * tests/gctest.c [GC_NO_FINALIZATION && !NO_TYPED_TEST] (NO_TYPED_TEST): Define macro.
Diffstat (limited to 'cord/tests')
-rw-r--r--cord/tests/cordtest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cord/tests/cordtest.c b/cord/tests/cordtest.c
index 16362973..44e36ba9 100644
--- a/cord/tests/cordtest.c
+++ b/cord/tests/cordtest.c
@@ -221,8 +221,10 @@ void test_extras(void)
*(CORD volatile *)&w = CORD_EMPTY;
*(CORD volatile *)&z = CORD_EMPTY;
GC_gcollect();
- GC_invoke_finalizers();
+# ifndef GC_NO_FINALIZATION
+ GC_invoke_finalizers();
/* Of course, this does not guarantee the files are closed. */
+# endif
if (remove(FNAME1) != 0) {
/* On some systems, e.g. OS2, this may fail if f1 is still open. */
/* But we cannot call fclose as it might lead to double close. */