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
This commit is contained in:
emboss 2012-09-03 22:54:12 +00:00
Родитель b6c38f6753
Коммит 4bb125f91a
7 изменённых файлов: 22 добавлений и 14 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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)

Просмотреть файл

@ -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

Просмотреть файл

@ -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|

Просмотреть файл

@ -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

Просмотреть файл

@ -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)