Skip to content

Commit a725b95

Browse files
committed
Add tests for MMTK_HEAP_MIN
1 parent 6a78ffa commit a725b95

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/mmtk/test_configuration.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ def test_MMTK_THREADS
2929
end
3030

3131
def test_MMTK_HEAP_MIN
32+
# Defaults to 1MiB
33+
assert_separately([], <<~RUBY)
34+
assert_equal(1 * 1024 * 1024, GC.config[:mmtk_heap_min])
35+
RUBY
36+
3237
# TODO: uncomment this test when the infinite loop is fixed
3338
# assert_separately([{ "MMTK_HEAP_MODE" => "dynamic", "MMTK_HEAP_MIN" => "1" }], <<~RUBY)
3439
# assert_equal(1, GC.config[:mmtk_heap_min])
@@ -39,6 +44,12 @@ def test_MMTK_HEAP_MIN
3944
RUBY
4045
end
4146

47+
def test_MMTK_HEAP_MIN_is_ignored_for_fixed_heaps
48+
assert_separately([{ "MMTK_HEAP_MODE" => "fixed", "MMTK_HEAP_MIN" => "1" }], <<~RUBY)
49+
assert_nil(GC.config[:mmtk_heap_min])
50+
RUBY
51+
end
52+
4253
def test_MMTK_HEAP_MAX
4354
assert_separately([{ "MMTK_HEAP_MODE" => "fixed", "MMTK_HEAP_MAX" => "100MiB" }], <<~RUBY)
4455
assert_equal(100 * 1024 * 1024, GC.config[:mmtk_heap_max])

0 commit comments

Comments
 (0)