aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2023-09-01 01:52:32 +0900
committerGitHub <noreply@github.com>2023-09-01 01:52:32 +0900
commitbdf060f85c5c297bb78c19d83c7511dbe7c418be (patch)
tree2a09120e4c80a3cd193a2e5c2f23062e4b2cd5af /test
parent3784b274e9ec8843c0e30bb056d37809d130bfeb (diff)
parent8c7a6a17e2bd5788ddbca8b5ac13c967fa59b284 (diff)
downloadruby-openssl-bdf060f85c5c297bb78c19d83c7511dbe7c418be.tar.gz
Merge pull request #677 from rhenium/ky/remove-mdebug
Remove OSSL_DEBUG compile-time option
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_engine.rb2
-rw-r--r--test/openssl/test_fips.rb6
-rw-r--r--test/openssl/test_provider.rb2
-rw-r--r--test/openssl/utils.rb20
4 files changed, 5 insertions, 25 deletions
diff --git a/test/openssl/test_engine.rb b/test/openssl/test_engine.rb
index 15434218..b6025f91 100644
--- a/test/openssl/test_engine.rb
+++ b/test/openssl/test_engine.rb
@@ -82,7 +82,7 @@ class OpenSSL::TestEngine < OpenSSL::TestCase
# this is required because OpenSSL::Engine methods change global state
def with_openssl(code, **opts)
- assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;", **opts)
+ assert_separately(["-ropenssl"], <<~"end;", **opts)
#{code}
end;
end
diff --git a/test/openssl/test_fips.rb b/test/openssl/test_fips.rb
index dfc1729b..43042bea 100644
--- a/test/openssl/test_fips.rb
+++ b/test/openssl/test_fips.rb
@@ -9,7 +9,7 @@ class OpenSSL::TestFIPS < OpenSSL::TestCase
omit "Only for FIPS mode environment"
end
- assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;")
+ assert_separately(["-ropenssl"], <<~"end;")
assert OpenSSL.fips_mode == true, ".fips_mode should return true on FIPS mode enabled"
end;
end
@@ -19,7 +19,7 @@ class OpenSSL::TestFIPS < OpenSSL::TestCase
omit "Only for non-FIPS mode environment"
end
- assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;")
+ assert_separately(["-ropenssl"], <<~"end;")
message = ".fips_mode should return false on FIPS mode disabled. " \
"If you run the test on FIPS mode, please set " \
"TEST_RUBY_OPENSSL_FIPS_ENABLED=true"
@@ -35,7 +35,7 @@ class OpenSSL::TestFIPS < OpenSSL::TestCase
def test_fips_mode_get_with_fips_mode_set
omit('OpenSSL is not FIPS-capable') unless OpenSSL::OPENSSL_FIPS
- assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;")
+ assert_separately(["-ropenssl"], <<~"end;")
begin
OpenSSL.fips_mode = true
assert OpenSSL.fips_mode == true, ".fips_mode should return true when .fips_mode=true"
diff --git a/test/openssl/test_provider.rb b/test/openssl/test_provider.rb
index 3040a4be..d0e66785 100644
--- a/test/openssl/test_provider.rb
+++ b/test/openssl/test_provider.rb
@@ -58,7 +58,7 @@ class OpenSSL::TestProvider < OpenSSL::TestCase
# this is required because OpenSSL::Provider methods change global state
def with_openssl(code, **opts)
- assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;", **opts)
+ assert_separately(["-ropenssl"], <<~"end;", **opts)
#{code}
end;
end
diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb
index 7ac80505..3856bea8 100644
--- a/test/openssl/utils.rb
+++ b/test/openssl/utils.rb
@@ -4,26 +4,6 @@ begin
rescue LoadError
end
-# Compile OpenSSL with crypto-mdebug and run this test suite with OSSL_MDEBUG=1
-# environment variable to enable memory leak check.
-if ENV["OSSL_MDEBUG"] == "1"
- if OpenSSL.respond_to?(:print_mem_leaks)
- OpenSSL.mem_check_start
-
- END {
- GC.start
- case OpenSSL.print_mem_leaks
- when nil
- warn "mdebug: check what is printed"
- when true
- raise "mdebug: memory leaks detected"
- end
- }
- else
- warn "OSSL_MDEBUG=1 is specified but OpenSSL is not built with crypto-mdebug"
- end
-end
-
require "test/unit"
require "core_assertions"
require "tempfile"