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

ruby-changes:40047

From: nagachika <ko1@a...>
Date: Thu, 15 Oct 2015 02:04:18 +0900 (JST)
Subject: [ruby-changes:40047] nagachika:r52128 (trunk): * test/objspace/test_objspace.rb

nagachika	2015-10-15 02:02:56 +0900 (Thu, 15 Oct 2015)

  New Revision: 52128

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

  Log:
    * test/objspace/test_objspace.rb
      (test_trace_object_allocations_start_stop_clear): clear object
      allocation table first to get rid of erronous detection for obj3.
      [ruby-dev:49095] [Bug #11271]

  Modified files:
    trunk/ChangeLog
    trunk/test/objspace/test_objspace.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52127)
+++ ChangeLog	(revision 52128)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Oct 15 01:57:03 2015  CHIKANAGA Tomoyuki  <nagachika@r...>
+
+	* test/objspace/test_objspace.rb
+	  (test_trace_object_allocations_start_stop_clear): clear object
+	  allocation table first to get rid of erronous detection for obj3.
+	  [ruby-dev:49095] [Bug #11271]
+
 Thu Oct 15 01:53:38 2015  Benoit Daloze  <eregontp@g...>
 
 	* test/ostruct/test_ostruct.rb: Add tests for OpenStruct#respond_to.
Index: test/objspace/test_objspace.rb
===================================================================
--- test/objspace/test_objspace.rb	(revision 52127)
+++ test/objspace/test_objspace.rb	(revision 52128)
@@ -177,6 +177,8 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L177
   end
 
   def test_trace_object_allocations_start_stop_clear
+    ObjectSpace.trace_object_allocations_clear # clear object_table to get rid of erronous detection for obj3
+    GC.disable # suppress potential object reuse. see [Bug #11271]
     begin
       ObjectSpace.trace_object_allocations_start
       begin
@@ -207,6 +209,8 @@ class TestObjSpace < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L209
     assert_equal(nil, ObjectSpace.allocation_sourcefile(obj1))
     assert_equal(nil, ObjectSpace.allocation_sourcefile(obj2))
     assert_equal(nil, ObjectSpace.allocation_sourcefile(obj3))
+  ensure
+    GC.enable
   end
 
   def test_dump_flags

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

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