Skip to content

Commit

Permalink
fix memory leaks in tests; cleanup files
Browse files Browse the repository at this point in the history
  • Loading branch information
TJ-91 committed Apr 8, 2024
1 parent 4e365aa commit b74386c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
8 changes: 0 additions & 8 deletions src/tests/data/test_crypto_refresh/v6_skesk_eax

This file was deleted.

Empty file.
5 changes: 4 additions & 1 deletion src/tests/ffi-enc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,14 +750,14 @@ TEST_F(rnp_tests, test_ffi_decrypt_v6_skesk_test_vectors)

assert_rnp_success(
rnp_input_from_path(&input, "data/test_crypto_refresh/v6_skesk_eax.asc"));
assert_rnp_success(rnp_output_to_null(&output));
assert_rnp_success(rnp_output_to_path(&output, "decrypted"));
assert_rnp_success(rnp_op_verify_create(&verify, ffi, input, output));
assert_rnp_success(rnp_op_verify_execute(verify));
assert_string_equal(file_to_str("decrypted").c_str(), "Hello, world!");
assert_int_equal(unlink("decrypted"), 0);
rnp_input_destroy(input);
rnp_output_destroy(output);
rnp_op_verify_destroy(verify);

assert_rnp_success(
rnp_input_from_path(&input, "data/test_crypto_refresh/v6_skesk_ocb.asc"));
Expand All @@ -768,6 +768,7 @@ TEST_F(rnp_tests, test_ffi_decrypt_v6_skesk_test_vectors)
assert_int_equal(unlink("decrypted"), 0);
rnp_input_destroy(input);
rnp_output_destroy(output);
rnp_op_verify_destroy(verify);

rnp_ffi_destroy(ffi);
}
Expand Down Expand Up @@ -800,6 +801,7 @@ TEST_F(rnp_tests, test_ffi_v6_skesk_enc_dec)
assert_rnp_success(rnp_op_encrypt_execute(enc));
rnp_input_destroy(input);
rnp_output_destroy(output);
rnp_op_encrypt_destroy(enc);

assert_rnp_success(rnp_ffi_set_pass_provider(
ffi, ffi_string_password_provider, (void *) "password"));
Expand All @@ -811,6 +813,7 @@ TEST_F(rnp_tests, test_ffi_v6_skesk_enc_dec)
assert_string_equal(file_to_str("decrypted").c_str(), plaintext);
rnp_input_destroy(input);
rnp_output_destroy(output);
rnp_op_verify_destroy(verify);

assert_int_equal(unlink("decrypted"), 0);
assert_int_equal(unlink("encrypted"), 0);
Expand Down

0 comments on commit b74386c

Please sign in to comment.