summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-18 04:40:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-18 04:40:15 +0000
commit815e8e992dd3beb427abc0985ff500bf71ca4da3 (patch)
treeeeec3c613304dc00cc9005193dca7b7ea57e6ab9 /test
parentc79c06fa1c3844225cd46ba5b41d8afe6fa27ab4 (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/stringio/test_stringio.rb8
1 files changed, 7 insertions, 1 deletions
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)