Skip to content

Commit

Permalink
tests: Improve _ge_set_all_gej(_var) tests
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Nov 1, 2024
1 parent 365f274 commit 300aab1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -3842,6 +3842,17 @@ static void test_ge(void) {
CHECK(secp256k1_ge_eq_var(&ge_set_all_var[i], &ge_set_all[i]));
}

/* Test with an array of length 1. */
secp256k1_ge_set_all_gej_var(ge_set_all_var, &gej[1], 1);
secp256k1_ge_set_all_gej(ge_set_all, &gej[1], 1);
CHECK(secp256k1_gej_eq_ge_var(&gej[1], &ge_set_all_var[1]));
CHECK(secp256k1_gej_eq_ge_var(&gej[1], &ge_set_all[1]));
CHECK(secp256k1_ge_eq_var(&ge_set_all_var[1], &ge_set_all[1]));

/* Test with an array of length 0. */
secp256k1_ge_set_all_gej_var(NULL, NULL, 0);
secp256k1_ge_set_all_gej(NULL, NULL, 0);

free(ge_set_all_var);
free(ge_set_all);
}
Expand Down

0 comments on commit 300aab1

Please sign in to comment.