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

ruby-changes:32194

From: nobu <ko1@a...>
Date: Wed, 18 Dec 2013 13:36:49 +0900 (JST)
Subject: [ruby-changes:32194] nobu:r44273 (trunk): test_gc.rb: refine assertion

nobu	2013-12-18 13:36:43 +0900 (Wed, 18 Dec 2013)

  New Revision: 44273

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

  Log:
    test_gc.rb: refine assertion
    
    * test/ruby/test_gc.rb (test_expand_heap): use assert_in_delta
      instead of bare assert.

  Modified files:
    trunk/test/ruby/test_gc.rb
Index: test/ruby/test_gc.rb
===================================================================
--- test/ruby/test_gc.rb	(revision 44272)
+++ test/ruby/test_gc.rb	(revision 44273)
@@ -251,8 +251,8 @@ 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((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}")
+    assert_in_delta base_length, GC.stat[:heap_eden_page_length], 1,
+           "invalid heap expanding (base_length: #{base_length}, GC.stat[:heap_eden_page_length]: #{v})")
 
     a = []
     (base_length * 500).times{ a << 'a'; nil }

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

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