Skip to content

Commit 6a873cc

Browse files
committed
Merge #1122: tests: Randomize the context with probability 15/16 instead of 1/4
17065f4 tests: Randomize the context with probability 15/16 instead of 1/4 (Tim Ruffing) Pull request description: ACKs for top commit: sipa: ACK 17065f4 jonasnick: ACK 17065f4 Tree-SHA512: 3b7005770007b922a294be610f23da60b0dde74dfd7585d64a2cb04eaa6ec879de8d21a0ade31c1857019a8dd97260fa3aa167ae16fc55027ef280a3e3feaa6d
2 parents 63a3565 + 17065f4 commit 6a873cc

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)