tests: Use global copy of secp256k1_context_static instead of clone

This commit is contained in:
Tim Ruffing
2022-12-07 14:56:43 +01:00
parent 2a39ac162e
commit b19806122e
4 changed files with 19 additions and 16 deletions

View File

@@ -128,8 +128,7 @@ void test_schnorrsig_api(void) {
secp256k1_schnorrsig_extraparams invalid_extraparams = {{ 0 }, NULL, NULL};
/** setup **/
secp256k1_context *sttc = secp256k1_context_clone(secp256k1_context_static);
int ecount;
int ecount = 0;
secp256k1_context_set_error_callback(ctx, counting_illegal_callback_fn, &ecount);
secp256k1_context_set_illegal_callback(ctx, counting_illegal_callback_fn, &ecount);
@@ -198,7 +197,8 @@ void test_schnorrsig_api(void) {
CHECK(secp256k1_schnorrsig_verify(ctx, sig, msg, sizeof(msg), &zero_pk) == 0);
CHECK(ecount == 4);
secp256k1_context_destroy(sttc);
secp256k1_context_set_error_callback(sttc, NULL, NULL);
secp256k1_context_set_illegal_callback(sttc, NULL, NULL);
}
/* Checks that hash initialized by secp256k1_schnorrsig_sha256_tagged has the