[前][次][番号順一覧][スレッド一覧]

ruby-changes:40931

From: nobu <ko1@a...>
Date: Thu, 10 Dec 2015 02:21:48 +0900 (JST)
Subject: [ruby-changes:40931] nobu:r53010 (trunk): test_ssl.rb: fix ssl option flags tests

nobu	2015-12-10 02:21:23 +0900 (Thu, 10 Dec 2015)

  New Revision: 53010

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53010

  Log:
    test_ssl.rb: fix ssl option flags tests
    
    * test/openssl/test_ssl.rb (test_setting_twice): ignore fixed
      falgs.  some flags like SSL_OP_NO_SSL_MASK cannot change.
    
    * test/openssl/test_ssl.rb (test_options_setting_nil_means_all):
      ditto.

  Modified files:
    trunk/test/openssl/test_ssl.rb
Index: test/openssl/test_ssl.rb
===================================================================
--- test/openssl/test_ssl.rb	(revision 53009)
+++ test/openssl/test_ssl.rb	(revision 53010)
@@ -28,7 +28,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl.rb#L28
   def test_setting_twice
     ctx = OpenSSL::SSL::SSLContext.new
     ctx.options = 4
-    assert_equal 4, ctx.options
+    assert_equal 4, (ctx.options & OpenSSL::SSL::OP_ALL)
     ctx.options = OpenSSL::SSL::OP_ALL
     assert_equal OpenSSL::SSL::OP_ALL, ctx.options
   end
@@ -36,7 +36,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl.rb#L36
   def test_options_setting_nil_means_all
     ctx = OpenSSL::SSL::SSLContext.new
     ctx.options = nil
-    assert_equal OpenSSL::SSL::OP_ALL, ctx.options
+    assert_equal(OpenSSL::SSL::OP_ALL, (OpenSSL::SSL::OP_ALL & ctx.options))
   end
 
   def test_setting_options_raises_after_setup

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]