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

ruby-changes:55421

From: tenderlove <ko1@a...>
Date: Sat, 20 Apr 2019 13:13:35 +0900 (JST)
Subject: [ruby-changes:55421] tenderlove:r67630 (trunk): add more assertions around moved object

tenderlove	2019-04-20 13:13:29 +0900 (Sat, 20 Apr 2019)

  New Revision: 67630

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

  Log:
    add more assertions around moved object

  Modified files:
    trunk/test/ruby/test_gc_compact.rb
Index: test/ruby/test_gc_compact.rb
===================================================================
--- test/ruby/test_gc_compact.rb	(revision 67629)
+++ test/ruby/test_gc_compact.rb	(revision 67630)
@@ -76,7 +76,14 @@ class TestGCCompact < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc_compact.rb#L76
     list_of_objects, addresses, new_tenant = try_to_move_objects
 
     # This is the object that used to be in new_object's position
-    previous_tenant = list_of_objects[addresses.index(memory_location(new_tenant))]
+    loc = memory_location(new_tenant)
+    assert loc, "should have a memory location"
+
+    address_idx = addresses.index(loc)
+    assert address_idx, "should have an address index"
+
+    previous_tenant = list_of_objects[address_idx]
+    assert previous_tenant, "should have a previous tenant"
 
     assert_not_equal previous_tenant.object_id, new_tenant.object_id
 

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

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