From 521d7152b940c280e44b180d64ead76dcda9cd8c Mon Sep 17 00:00:00 2001 From: Tim Ruffing Date: Tue, 8 Oct 2024 13:57:27 +0200 Subject: [PATCH] tests: Improve _ge_set_all_gej(_var) tests --- src/tests.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tests.c b/src/tests.c index 61e7581506..2d2c8e6eb5 100644 --- a/src/tests.c +++ b/src/tests.c @@ -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); }