summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorSergey Avseyev <sergey.avseyev@gmail.com>2018-01-18 11:04:32 +0300
committerAndreas Rumpf <rumpf_a@web.de>2018-01-18 09:04:32 +0100
commitd9c922fc70b226b1c64c11d5ed3599c7b9322fd5 (patch)
treec428e251637cd2ae1b0de4bdad5549dc60869bcf /tests
parentb754bfabb625d9ecac4939a156e0499e0f476370 (diff)
downloadNim-d9c922fc70b226b1c64c11d5ed3599c7b9322fd5.tar.gz
Fix gc tests for BoehmGC (#7094)
Diffstat (limited to 'tests')
-rw-r--r--tests/gc/gcleak.nim3
-rw-r--r--tests/gc/gcleak2.nim4
-rw-r--r--tests/gc/gcleak4.nim2
3 files changed, 3 insertions, 6 deletions
diff --git a/tests/gc/gcleak.nim b/tests/gc/gcleak.nim
index 4e47db609..8852a8d91 100644
--- a/tests/gc/gcleak.nim
+++ b/tests/gc/gcleak.nim
@@ -13,11 +13,10 @@ proc MakeObj(): TTestObj =
   result.x = "Hello"
 
 for i in 1 .. 1_000_000:
-  when defined(gcMarkAndSweep):
+  when defined(gcMarkAndSweep) or defined(boehmgc):
     GC_fullcollect()
   var obj = MakeObj()
   if getOccupiedMem() > 300_000: quit("still a leak!")
 #  echo GC_getstatistics()
 
 echo "no leak: ", getOccupiedMem()
-
diff --git a/tests/gc/gcleak2.nim b/tests/gc/gcleak2.nim
index 101421683..facb8a008 100644
--- a/tests/gc/gcleak2.nim
+++ b/tests/gc/gcleak2.nim
@@ -16,7 +16,7 @@ proc MakeObj(): TTestObj =
 
 proc inProc() =
   for i in 1 .. 1_000_000:
-    when defined(gcMarkAndSweep):
+    when defined(gcMarkAndSweep) or defined(boehmgc):
       GC_fullcollect()
     var obj: TTestObj
     obj = MakeObj()
@@ -24,5 +24,3 @@ proc inProc() =
 
 inProc()
 echo "no leak: ", getOccupiedMem()
-
-
diff --git a/tests/gc/gcleak4.nim b/tests/gc/gcleak4.nim
index d93a13854..e9b17e557 100644
--- a/tests/gc/gcleak4.nim
+++ b/tests/gc/gcleak4.nim
@@ -38,7 +38,7 @@ proc newPlus(a, b: ref TExpr): ref TPlusExpr =
   result.b = b
   result.op2 = $getOccupiedMem()
 
-const Limit = when compileOption("gc", "markAndSweep"): 5*1024*1024 else: 500_000
+const Limit = when compileOption("gc", "markAndSweep") or compileOption("gc", "boehm"): 5*1024*1024 else: 500_000
 
 for i in 0..100_000:
   var s: array[0..11, ref TExpr]