summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-03 22:54:12 +0000
committeremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-03 22:54:12 +0000
commit4bb125f91a1df7d5252b1dd1f59c1ce0238e0192 (patch)
treee1dd5082f2e1c74a2fc13cda5f29c2ba8e4b62ff
parentb6c38f675356cf6da84e35c8a9ed57922130e580 (diff)
* test/openssl/test_asn1_rb:
test/openssl/test_ssl_session.rb: test/openssl/test_x509name.rb: test/openssl/test_buffering.rb: test/openssl/test_x509cert.rb: test/openssl/test_ssl.rb: Refactor code that leads to warnings on Ruby CI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--test/openssl/test_asn1.rb2
-rw-r--r--test/openssl/test_buffering.rb1
-rw-r--r--test/openssl/test_ssl.rb2
-rw-r--r--test/openssl/test_ssl_session.rb6
-rw-r--r--test/openssl/test_x509cert.rb13
-rw-r--r--test/openssl/test_x509name.rb2
7 files changed, 22 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 68d512a31de..539bde686a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue Sep 4 07:48:35 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
+
+ * test/openssl/test_asn1_rb:
+ test/openssl/test_ssl_session.rb:
+ test/openssl/test_x509name.rb:
+ test/openssl/test_buffering.rb:
+ test/openssl/test_x509cert.rb:
+ test/openssl/test_ssl.rb: Refactor code that leads to warnings on
+ Ruby CI.
+
Tue Sep 4 07:02:56 2012 Martin Bosslet <Martin.Bosslet@googlemail.com>
* test/openssl/utils.rb: Use DSS1 as DSA signature digest for all
diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb
index e67a96a03a6..736655a30b9 100644
--- a/test/openssl/test_asn1.rb
+++ b/test/openssl/test_asn1.rb
@@ -247,7 +247,7 @@ rEzBQ0F9dUyqQ9gyRg8KHhDfv9HzT1d/rnUZMkoombwYBRIUChGCYV0GnJcan2Zm
assert_equal(false, prim.infinite_length)
prim.infinite_length = true
flunk('Could set infinite length on primitive value')
- rescue NoMethodError => e
+ rescue NoMethodError
#ok
end
end
diff --git a/test/openssl/test_buffering.rb b/test/openssl/test_buffering.rb
index 1e2197533a6..c4894e12913 100644
--- a/test/openssl/test_buffering.rb
+++ b/test/openssl/test_buffering.rb
@@ -70,7 +70,6 @@ class OpenSSL::TestBuffering < Test::Unit::TestCase
def test_getc
@io.syswrite('abc')
- res = []
assert_equal(?a, @io.getc)
assert_equal(?b, @io.getc)
assert_equal(?c, @io.getc)
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
index 74c7af52f8c..98ed8ca9277 100644
--- a/test/openssl/test_ssl.rb
+++ b/test/openssl/test_ssl.rb
@@ -579,7 +579,7 @@ if OpenSSL::OPENSSL_VERSION_NUMBER > 0x10001000
ctx.npn_select_cb = -> (protocols) { "a" * 256 }
assert_raise(*HANDSHAKE_ERRORS) { server_connect(port, ctx) }
}
- end
+ end
end
diff --git a/test/openssl/test_ssl_session.rb b/test/openssl/test_ssl_session.rb
index d04ebe27172..69a3a0d8764 100644
--- a/test/openssl/test_ssl_session.rb
+++ b/test/openssl/test_ssl_session.rb
@@ -135,7 +135,7 @@ __EOS__
def test_session_timeout
sess = OpenSSL::SSL::Session.new(DUMMY_SESSION_NO_EXT)
assert_raise(TypeError) do
- sess.timeout = (now = Time.now)
+ sess.timeout = Time.now
end
sess.timeout = 1
assert_equal(1, sess.timeout.to_i)
@@ -337,8 +337,8 @@ __EOS__
}
server_proc = Proc.new { |c, ssl|
- session = ssl.session
- stats = c.session_cache_stats
+ ssl.session
+ c.session_cache_stats
readwrite_loop(c, ssl)
}
start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, :ctx_proc => ctx_proc, :server_proc => server_proc) do |server, port|
diff --git a/test/openssl/test_x509cert.rb b/test/openssl/test_x509cert.rb
index 1c47b2b42b0..dd5751eb48b 100644
--- a/test/openssl/test_x509cert.rb
+++ b/test/openssl/test_x509cert.rb
@@ -38,7 +38,6 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
]
sha1 = OpenSSL::Digest::SHA1.new
- dss1 = OpenSSL::Digest::DSS1.new
dsa_digest = OpenSSL::TestUtils::DSA_SIGNATURE_DIGEST.new
[
@@ -168,20 +167,20 @@ class OpenSSL::TestX509Certificate < Test::Unit::TestCase
end
assert_raise(OpenSSL::X509::CertificateError){
- cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::MD5.new)
+ issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
+ nil, nil, OpenSSL::Digest::MD5.new)
}
end
def test_dsig_algorithm_mismatch
assert_raise(OpenSSL::X509::CertificateError) do
- cert = issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::DSS1.new)
+ issue_cert(@ca, @rsa2048, 1, Time.now, Time.now+3600, [],
+ nil, nil, OpenSSL::Digest::DSS1.new)
end if OpenSSL::OPENSSL_VERSION_NUMBER < 0x10001000 # [ruby-core:42949]
assert_raise(OpenSSL::X509::CertificateError) do
- cert = issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
- nil, nil, OpenSSL::Digest::MD5.new)
+ issue_cert(@ca, @dsa512, 1, Time.now, Time.now+3600, [],
+ nil, nil, OpenSSL::Digest::MD5.new)
end
end
diff --git a/test/openssl/test_x509name.rb b/test/openssl/test_x509name.rb
index 90c09929cee..0a223438ba9 100644
--- a/test/openssl/test_x509name.rb
+++ b/test/openssl/test_x509name.rb
@@ -339,7 +339,7 @@ class OpenSSL::TestX509Name < Test::Unit::TestCase
n1 = OpenSSL::X509::Name.parse 'CN=a'
n2 = OpenSSL::X509::Name.parse 'CN=b'
- assert_equal -1, n1 <=> n2
+ assert_equal(-1, n1 <=> n2)
end
def name_hash(name)