Skip to content

Commit

Permalink
tests: remove unnecessary test in run_ec_pubkey_parse_test
Browse files Browse the repository at this point in the history
This test tested whether setting the callback works correctly which should be
tested in the context tests.
  • Loading branch information
jonasnick committed Sep 4, 2023
1 parent 875b0ad commit a1d52e3
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -5983,7 +5983,6 @@ static void run_ec_pubkey_parse_test(void) {
size_t len;
int32_t i;
int32_t ecount;
int32_t ecount2;
ecount = 0;
/* Nothing should be reading this far into pubkeyc. */
SECP256K1_CHECKMEM_UNDEFINE(&pubkeyc[65], 1);
Expand Down Expand Up @@ -6104,15 +6103,8 @@ static void run_ec_pubkey_parse_test(void) {
CHECK(len == 65);
/* Multiple illegal args. Should still set arg error only once. */
ecount = 0;
ecount2 = 11;
CHECK(secp256k1_ec_pubkey_parse(CTX, NULL, NULL, 65) == 0);
CHECK(ecount == 1);
/* Does the illegal arg callback actually change the behavior? */
secp256k1_context_set_illegal_callback(CTX, uncounting_illegal_callback_fn, &ecount2);
CHECK(secp256k1_ec_pubkey_parse(CTX, NULL, NULL, 65) == 0);
CHECK(ecount == 1);
CHECK(ecount2 == 10);
secp256k1_context_set_illegal_callback(CTX, NULL, NULL);
/* Try a bunch of prefabbed points with all possible encodings. */
for (i = 0; i < SECP256K1_EC_PARSE_TEST_NVALID; i++) {
ec_pubkey_parse_pointtest(valid[i], 1, 1);
Expand Down

0 comments on commit a1d52e3

Please sign in to comment.