Skip to content

Commit

Permalink
test, ci: Lower default iteration count to 16
Browse files Browse the repository at this point in the history
The number of test iterations in the CI remains unchanged.

Additionally, the minimum iteration counts to enable the following tests
are adjusted:
 - `run_sha256_known_output_tests`: 16 -> 32, so it's not run by default
 - `test_ecmult_constants_2bit`: 35 -> 16, so it's run by default
  • Loading branch information
hebasto committed Oct 22, 2024
1 parent 3fdf146 commit 9743bce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:
SCHNORRSIG: no
ELLSWIFT: no
### test options
SECP256K1_TEST_ITERS:
SECP256K1_TEST_ITERS: 64
BENCH: yes
SECP256K1_BENCH_ITERS: 2
CTIMETESTS: yes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ env:
SCHNORRSIG: 'no'
ELLSWIFT: 'no'
### test options
SECP256K1_TEST_ITERS:
SECP256K1_TEST_ITERS: 64
BENCH: 'yes'
SECP256K1_BENCH_ITERS: 2
CTIMETESTS: 'yes'
Expand Down
6 changes: 3 additions & 3 deletions src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#define CONDITIONAL_TEST(cnt, nam) if (COUNT < (cnt)) { printf("Skipping %s (iteration count too low)\n", nam); } else

static int COUNT = 64;
static int COUNT = 16;
static secp256k1_context *CTX = NULL;
static secp256k1_context *STATIC_CTX = NULL;

Expand Down Expand Up @@ -475,7 +475,7 @@ static void run_sha256_known_output_tests(void) {

/* Skip last input vector for low iteration counts */
ninputs = sizeof(inputs)/sizeof(inputs[0]) - 1;
CONDITIONAL_TEST(16, "run_sha256_known_output_tests 1000000") ninputs++;
CONDITIONAL_TEST(32, "run_sha256_known_output_tests 1000000") ninputs++;

for (i = 0; i < ninputs; i++) {
unsigned char out[32];
Expand Down Expand Up @@ -5515,7 +5515,7 @@ static void run_ecmult_constants(void) {
test_ecmult_constants_sha(1607366309u, 2048, expected32_8bit8);
}

CONDITIONAL_TEST(35, "test_ecmult_constants_2bit") {
CONDITIONAL_TEST(16, "test_ecmult_constants_2bit") {
test_ecmult_constants_2bit();
}
}
Expand Down

0 comments on commit 9743bce

Please sign in to comment.