diff options
Diffstat (limited to 'test/stringio/test_stringio.rb')
-rw-r--r-- | test/stringio/test_stringio.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb index ae8e845497..b0eff57c77 100644 --- a/test/stringio/test_stringio.rb +++ b/test/stringio/test_stringio.rb @@ -237,9 +237,8 @@ class TestStringIO < Test::Unit::TestCase def test_write_integer_overflow f = StringIO.new + f.pos = StringIO::MAX_LENGTH assert_raise(ArgumentError) { - # JRuby errors when setting pos to an out-of-range value - f.pos = RbConfig::LIMITS["LONG_MAX"] f.write("pos + len overflows") } end @@ -900,8 +899,9 @@ class TestStringIO < Test::Unit::TestCase end def test_overflow - return if RbConfig::SIZEOF["void*"] > RbConfig::SIZEOF["long"] - limit = RbConfig::LIMITS["INTPTR_MAX"] - 0x10 + intptr_max = RbConfig::LIMITS["INTPTR_MAX"] + return if intptr_max > StringIO::MAX_LENGTH + limit = intptr_max - 0x10 assert_separately(%w[-rstringio], "#{<<-"begin;"}\n#{<<-"end;"}") begin; limit = #{limit} |