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

ruby-changes:43313

From: rhe <ko1@a...>
Date: Sun, 12 Jun 2016 13:48:16 +0900 (JST)
Subject: [ruby-changes:43313] rhe:r55387 (trunk): openssl: avoid test failure in test_engine.rb

rhe	2016-06-12 13:48:10 +0900 (Sun, 12 Jun 2016)

  New Revision: 55387

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

  Log:
    openssl: avoid test failure in test_engine.rb
    
    * test/openssl/test_engine.rb (test_openssl_engine_builtin,
      test_openssl_engine_by_id_string): Skip test if 'openssl' engine is
      already loaded. And test the number increased by Engine.load{_by_id,},
      not the total count of loaded engines. Previously, we called
      OpenSSL::Engine.cleanup every time running a test case, but we no
      longer can do it.
      [ruby-core:75225] [Feature #12324]

  Modified files:
    trunk/ChangeLog
    trunk/test/openssl/test_engine.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 55386)
+++ ChangeLog	(revision 55387)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Jun 12 13:47:42 2016  Kazuki Yamaguchi  <k@r...>
+
+	* test/openssl/test_engine.rb (test_openssl_engine_builtin,
+	  test_openssl_engine_by_id_string): Skip test if 'openssl' engine is
+	  already loaded. And test the number increased by Engine.load{_by_id,},
+	  not the total count of loaded engines. Previously, we called
+	  OpenSSL::Engine.cleanup every time running a test case, but we no
+	  longer can do it.
+	  [ruby-core:75225] [Feature #12324]
+
 Sun Jun 12 09:24:34 2016  Nobuyoshi Nakada  <nobu@r...>
 
 	* file.c (append_fspath): normalize directory name to be appended
Index: test/openssl/test_engine.rb
===================================================================
--- test/openssl/test_engine.rb	(revision 55386)
+++ test/openssl/test_engine.rb	(revision 55387)
@@ -13,17 +13,21 @@ class OpenSSL::TestEngine < OpenSSL::Tes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_engine.rb#L13
 
   def test_openssl_engine_builtin
     with_openssl <<-'end;'
+      orig = OpenSSL::Engine.engines
+      skip "'openssl' is already loaded" if orig.any? { |e| e.id == "openssl" }
       engine = OpenSSL::Engine.load("openssl")
       assert_equal(true, engine)
-      assert_equal(1, OpenSSL::Engine.engines.size)
+      assert_equal(1, OpenSSL::Engine.engines.size - orig.size)
     end;
   end
 
   def test_openssl_engine_by_id_string
     with_openssl <<-'end;'
+      orig = OpenSSL::Engine.engines
+      skip "'openssl' is already loaded" if orig.any? { |e| e.id == "openssl" }
       engine = get_engine
       assert_not_nil(engine)
-      assert_equal(1, OpenSSL::Engine.engines.size)
+      assert_equal(1, OpenSSL::Engine.engines.size - orig.size)
     end;
   end
 

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

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