Skip to content

Commit 066c16e

Browse files
real-or-randomdderjoel
authored andcommitted
tests: Randomize the context with probability 15/16 instead of 1/4
1 parent 47c3525 commit 066c16e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tests.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -7086,11 +7086,15 @@ int main(int argc, char **argv) {
70867086
run_context_tests(0);
70877087
run_context_tests(1);
70887088
run_scratch_tests();
7089+
70897090
ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);
7090-
if (secp256k1_testrand_bits(1)) {
7091+
/* Randomize the context only with probability 15/16
7092+
to make sure we test without context randomization from time to time.
7093+
TODO Reconsider this when recalibrating the tests. */
7094+
if (secp256k1_testrand_bits(4)) {
70917095
unsigned char rand32[32];
70927096
secp256k1_testrand256(rand32);
7093-
CHECK(secp256k1_context_randomize(ctx, secp256k1_testrand_bits(1) ? rand32 : NULL));
7097+
CHECK(secp256k1_context_randomize(ctx, rand32));
70947098
}
70957099

70967100
run_rand_bits();

0 commit comments

Comments
 (0)