summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-18 00:01:08 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-18 00:01:08 +0000
commit2648a803c12a9885712cdd0419a2edd35df54e2b (patch)
tree5ba6ca83d52ca3b9771920bbbe6e904986ad8bc4 /test
parent5760abaf088c514e9fdd3108a0cb13419e8a7642 (diff)
* test/ruby/test_gc.rb (test_expand_heap): allow +/-1 diff.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_gc.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 1a7b38dbea..800fa346c2 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -251,12 +251,13 @@ class TestGc < Test::Unit::TestCase
base_length = GC.stat[:heap_eden_page_length]
(base_length * 500).times{ 'a' }
GC.start
- assert_equal base_length, GC.stat[:heap_eden_page_length], "invalid heap expanding"
+ assert((base_length-1 .. base_length+1) === (v = GC.stat[:heap_eden_page_length]),
+ "invalid heap expanding (base_length: #{base_length}, GC.stat[:heap_eden_page_length]: #{v}")
a = []
(base_length * 500).times{ a << 'a'; nil }
GC.start
- assert_operator base_length, :<, GC.stat[:heap_eden_page_length]
+ assert_operator base_length, :<, GC.stat[:heap_eden_page_length] + 1
eom
end