Skip to content

Commit

Permalink
Fix tests for case with unavailable blowfish cipher.
Browse files Browse the repository at this point in the history
  • Loading branch information
ni4 committed Jan 15, 2024
1 parent 98576dc commit aecfb55
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/tests/ffi-enc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,16 @@ TEST_F(rnp_tests, test_ffi_encrypt_pass)
assert_rnp_failure(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, "TWOFISH"));
assert_rnp_failure(
rnp_op_encrypt_add_password(op, "pass2", "SHA256", 12345, "TWOFISH"));
assert_rnp_success(
rnp_op_encrypt_add_password(op, "pass2", "SHA256", 12345, "BLOWFISH"));
const char *alg = blowfish_enabled() ? "BLOWFISH" : "AES256";
assert_rnp_success(rnp_op_encrypt_add_password(op, "pass2", "SHA256", 12345, alg));

Check warning on line 182 in src/tests/ffi-enc.cpp

View check run for this annotation

Codecov / codecov/patch

src/tests/ffi-enc.cpp#L181-L182

Added lines #L181 - L182 were not covered by tests
} else if (!sm2_enabled() && twofish_enabled()) {
assert_rnp_failure(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, "TWOFISH"));
assert_rnp_success(
rnp_op_encrypt_add_password(op, "pass2", "SHA256", 12345, "TWOFISH"));
} else if (sm2_enabled() && !twofish_enabled()) {
assert_rnp_failure(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, "TWOFISH"));
assert_rnp_success(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, "BLOWFISH"));
const char *alg = blowfish_enabled() ? "BLOWFISH" : "AES256";
assert_rnp_success(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, alg));

Check warning on line 190 in src/tests/ffi-enc.cpp

View check run for this annotation

Codecov / codecov/patch

src/tests/ffi-enc.cpp#L189-L190

Added lines #L189 - L190 were not covered by tests
} else {
assert_rnp_success(rnp_op_encrypt_add_password(op, "pass2", "SM3", 12345, "TWOFISH"));
}
Expand Down

0 comments on commit aecfb55

Please sign in to comment.