diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-20 04:13:29 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-20 04:13:29 +0000 |
commit | c98d1f182d1b5870272e25b7e636b49849f2c71c (patch) | |
tree | a2310374e054585a661a96e4fa30b1543a96b477 /test/ruby/test_gc_compact.rb | |
parent | 243842f68a97a34a36a7e8c690efe7e18bf81e91 (diff) | |
download | ruby-c98d1f182d1b5870272e25b7e636b49849f2c71c.tar.gz |
add more assertions around moved object
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_gc_compact.rb')
-rw-r--r-- | test/ruby/test_gc_compact.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/ruby/test_gc_compact.rb b/test/ruby/test_gc_compact.rb index 0fc27a287a..09b8d9d477 100644 --- a/test/ruby/test_gc_compact.rb +++ b/test/ruby/test_gc_compact.rb @@ -76,7 +76,14 @@ class TestGCCompact < Test::Unit::TestCase 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 |