Skip to content

Commit 0cebb0e

Browse files
committed
Refactoring: Use unless over if for negative conditions for aws_lc?.
See <https://github.com/rubocop/ruby-style-guide?tab=readme-ov-file#if-vs-unless>.
1 parent 1457c99 commit 0cebb0e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

test/openssl/test_bn.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def test_ractor
366366
assert_equal(true, Ractor.new(@e2) { _1.negative? }.take)
367367
assert_include(128..255, Ractor.new { OpenSSL::BN.rand(8)}.take)
368368
assert_include(0...2**32, Ractor.new { OpenSSL::BN.generate_prime(32) }.take)
369-
if !aws_lc? # AWS-LC does not support BN::CONSTTIME.
369+
unless aws_lc? # AWS-LC does not support BN::CONSTTIME.
370370
assert_equal(0, Ractor.new { OpenSSL::BN.new(999).get_flags(OpenSSL::BN::CONSTTIME) }.take)
371371
end
372372
# test if shareable when frozen

test/openssl/test_pkey_dh.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_new_generate
1919
end if ENV["OSSL_TEST_ALL"]
2020

2121
def test_new_break_on_non_fips
22-
omit_on_fips if !aws_lc?
22+
omit_on_fips unless aws_lc?
2323

2424
assert_nil(OpenSSL::PKey::DH.new(NEW_KEYLEN) { break })
2525
assert_raise(RuntimeError) do

test/openssl/test_ssl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,7 @@ def test_get_ephemeral_key
17471747
end
17481748
end
17491749

1750-
if !aws_lc? # AWS-LC does not support DHE ciphersuites.
1750+
unless aws_lc? # AWS-LC does not support DHE ciphersuites.
17511751
# DHE
17521752
# TODO: SSL_CTX_set1_groups() is required for testing this with TLS 1.3
17531753
ctx_proc2 = proc { |ctx|

0 commit comments

Comments
 (0)