[前][次][番号順一覧][スレッド一覧]

ruby-changes:32189

From: ko1 <ko1@a...>
Date: Wed, 18 Dec 2013 09:01:14 +0900 (JST)
Subject: [ruby-changes:32189] ko1:r44268 (trunk): * test/ruby/test_gc.rb (test_expand_heap): allow +/-1 diff.

ko1	2013-12-18 09:01:08 +0900 (Wed, 18 Dec 2013)

  New Revision: 44268

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44268

  Log:
    * test/ruby/test_gc.rb (test_expand_heap): allow +/-1 diff.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_gc.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44267)
+++ ChangeLog	(revision 44268)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Dec 18 09:00:17 2013  Koichi Sasada  <ko1@a...>
+
+	* test/ruby/test_gc.rb (test_expand_heap): allow +/-1 diff.
+
 Tue Dec 17 23:44:15 2013  Kazuki Tsujimoto  <kazuki@c...>
 
 	* test/ruby/test_io.rb: fix duplicated test name.
Index: test/ruby/test_gc.rb
===================================================================
--- test/ruby/test_gc.rb	(revision 44267)
+++ test/ruby/test_gc.rb	(revision 44268)
@@ -251,12 +251,13 @@ class TestGc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L251
     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
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]