Skip to content

Commit f54e5b4

Browse files
committed
Move MAX_EMBEDDED_MEMBERS into test
Some of the constants may be undefined in MMTk, so we need to skip this test.
1 parent 3394978 commit f54e5b4

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

test/ruby/test_struct.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ def test_morethan10members
4141
end
4242
end
4343

44-
MAX_EMBEDDED_MEMBERS = (
45-
GC::INTERNAL_CONSTANTS[:RVARGC_MAX_ALLOCATE_SIZE] -
46-
GC::INTERNAL_CONSTANTS[:RBASIC_SIZE] -
47-
GC::INTERNAL_CONSTANTS[:RVALUE_OVERHEAD]
48-
) / RbConfig::SIZEOF["void*"]
49-
5044
def test_larger_than_largest_pool
51-
count = MAX_EMBEDDED_MEMBERS + 1
45+
max_embedded_members = (
46+
GC::INTERNAL_CONSTANTS[:RVARGC_MAX_ALLOCATE_SIZE] -
47+
GC::INTERNAL_CONSTANTS[:RBASIC_SIZE] -
48+
GC::INTERNAL_CONSTANTS[:RVALUE_OVERHEAD]
49+
) / RbConfig::SIZEOF["void*"]
50+
51+
count = max_embedded_members + 1
5252
list = Array(0..count)
5353
klass = @Struct.new(*list.map { |i| :"a_#{i}"})
5454
struct = klass.new(*list)

0 commit comments

Comments
 (0)