summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_pair.rb8
-rw-r--r--test/openssl/test_ssl.rb8
2 files changed, 12 insertions, 4 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index c7cfd691298..c2ad735d2ae 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -112,9 +112,13 @@ module OpenSSL::TestPairM
ssl_pair {|s1, s2|
s2.write "a\nbcd"
assert_equal("a\n", s1.gets)
- assert_equal("bcd", s1.readpartial(10))
+ result = ""
+ result << s1.readpartial(10) until result.length == 3
+ assert_equal("bcd", result)
s2.write "efg"
- assert_equal("efg", s1.readpartial(10))
+ result = ""
+ result << s1.readpartial(10) until result.length == 3
+ assert_equal("efg", result)
s2.close
assert_raise(EOFError) { s1.readpartial(10) }
assert_raise(EOFError) { s1.readpartial(10) }
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
index 339451e7be9..23dc5728709 100644
--- a/test/openssl/test_ssl.rb
+++ b/test/openssl/test_ssl.rb
@@ -78,13 +78,17 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase
ITERATIONS.times{|i|
str = "x" * 100 + "\n"
ssl.syswrite(str)
- assert_equal(str, ssl.sysread(str.size))
+ newstr = ''
+ newstr << ssl.sysread(str.size - newstr.size) until newstr.size == str.size
+ assert_equal(str, newstr)
str = "x" * i * 100 + "\n"
buf = ""
ssl.syswrite(str)
assert_equal(buf.object_id, ssl.sysread(str.size, buf).object_id)
- assert_equal(str, buf)
+ newstr = buf
+ newstr << ssl.sysread(str.size - newstr.size) until newstr.size == str.size
+ assert_equal(str, newstr)
}
# puts and gets