From 815e8e992dd3beb427abc0985ff500bf71ca4da3 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 18 Jun 2016 04:40:15 +0000 Subject: 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 --- test/stringio/test_stringio.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb index ce84800d4b..5dd5de988a 100644 --- a/test/stringio/test_stringio.rb +++ b/test/stringio/test_stringio.rb @@ -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) -- cgit v1.2.3