Assert that resizing arrays will re-embed them

This commit is contained in:
Peter Zhu 2023-01-06 09:14:30 -05:00
Родитель 682b45d489
Коммит 2ad081f799
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -311,7 +311,7 @@ class TestGCCompact < Test::Unit::TestCase
def test_moving_arrays_down_size_pools
omit if GC::INTERNAL_CONSTANTS[:SIZE_POOL_COUNT] == 1
assert_separately([], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
assert_separately(%w[-robjspace], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
begin;
ARY_COUNT = 500
@ -324,14 +324,14 @@ class TestGCCompact < Test::Unit::TestCase
stats = GC.verify_compaction_references(expand_heap: true, toward: :empty)
assert_operator(stats.dig(:moved_down, :T_ARRAY) || 0, :>=, ARY_COUNT)
assert(arys) # warning: assigned but unused variable - arys
assert_include(ObjectSpace.dump(arys[0]), '"embedded":true')
end;
end
def test_moving_arrays_up_size_pools
omit if GC::INTERNAL_CONSTANTS[:SIZE_POOL_COUNT] == 1
assert_separately([], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
assert_separately(%w[-robjspace], "#{<<~"begin;"}\n#{<<~"end;"}", timeout: 10, signal: :SEGV)
begin;
ARY_COUNT = 500
@ -346,7 +346,7 @@ class TestGCCompact < Test::Unit::TestCase
stats = GC.verify_compaction_references(expand_heap: true, toward: :empty)
assert_operator(stats.dig(:moved_up, :T_ARRAY) || 0, :>=, ARY_COUNT)
assert(arys) # warning: assigned but unused variable - arys
assert_include(ObjectSpace.dump(arys[0]), '"embedded":true')
end;
end