diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-07-10 23:25:17 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-07-10 23:25:17 +0900 |
commit | ffc3781d219bae041929eb65b63b416673b7db32 (patch) | |
tree | 160f49668783cddcab8d49179dedd7d783b34a1d /test/test_pair.rb | |
parent | 9d5c823c07b576a4cce55d75392064182b2ec3bc (diff) | |
download | ruby-openssl-ffc3781d219bae041929eb65b63b416673b7db32.tar.gz |
Suppress warnings in tests
Diffstat (limited to 'test/test_pair.rb')
-rw-r--r-- | test/test_pair.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/test_pair.rb b/test/test_pair.rb index 575cb6c1..cf9b9303 100644 --- a/test/test_pair.rb +++ b/test/test_pair.rb @@ -330,7 +330,7 @@ module OpenSSL::TestPairM ctx2.tmp_dh_callback = nil sock1, sock2 = tcp_pair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) - accepted = s2.accept_nonblock(exception: false) + s2.accept_nonblock(exception: false) ctx1 = OpenSSL::SSL::SSLContext.new ctx1.ciphers = "DH" @@ -339,16 +339,16 @@ module OpenSSL::TestPairM s1 = OpenSSL::SSL::SSLSocket.new(sock1, ctx1) t = Thread.new { s1.connect } - accept = s2.accept + EnvUtil.suppress_warning { # uses default callback + assert_nothing_raised { s2.accept } + } assert_equal s1, t.value - assert accept ensure t.join if t s1.close if s1 s2.close if s2 sock1.close if sock1 sock2.close if sock2 - accepted.close if accepted.respond_to?(:close) end def test_connect_without_setting_dh_callback @@ -357,7 +357,7 @@ module OpenSSL::TestPairM ctx2.security_level = 0 sock1, sock2 = tcp_pair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) - accepted = s2.accept_nonblock(exception: false) + s2.accept_nonblock(exception: false) ctx1 = OpenSSL::SSL::SSLContext.new ctx1.ciphers = "DH" @@ -365,16 +365,16 @@ module OpenSSL::TestPairM s1 = OpenSSL::SSL::SSLSocket.new(sock1, ctx1) t = Thread.new { s1.connect } - accept = s2.accept + EnvUtil.suppress_warning { # default DH + assert_nothing_raised { s2.accept } + } assert_equal s1, t.value - assert accept ensure t.join if t s1.close if s1 s2.close if s2 sock1.close if sock1 sock2.close if sock2 - accepted.close if accepted.respond_to?(:close) end def test_ecdh_callback @@ -411,7 +411,7 @@ module OpenSSL::TestPairM end until rv == s1 end - accepted = s2.accept + s2.accept assert called, 'ecdh callback should be called' rescue OpenSSL::SSL::SSLError => e if e.message =~ /no cipher match/ |