1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Refine test of r55432

* test/stringio/test_stringio.rb (test_overflow): refine the
  conditinon, try to allocate strings until the buffer is located
  in higher half address.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-06-18 04:40:15 +00:00
parent c79c06fa1c
commit 815e8e992d

View file

@ -686,7 +686,13 @@ class TestStringIO < Test::Unit::TestCase
assert_separately(%w[-rstringio], "#{<<-"begin;"}\n#{<<-"end;"}")
begin;
limit = #{limit}
x = ("a"*0x100000)
ary = []
while true
x = "a"*0x100000
break if [x].pack("p").unpack("i!")[0] < 0
ary << x
skip if ary.size > 1000
end
s = StringIO.new(x)
s.gets("xxx", limit)
assert_equal(0x100000, s.pos)