Skip to content

Commit 63e1b2a

Browse files
committed
Disable output buffering in tests_exhaustive.c
1 parent 39f67dd commit 63e1b2a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/tests_exhaustive.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,14 @@ int main(int argc, char** argv) {
353353
unsigned char rand32[32];
354354
secp256k1_context *ctx;
355355

356+
/* Disable buffering for stdout to improve reliability of getting
357+
* diagnostic information. Happens right at the start of main because
358+
* setbuf must be used before any other operation on the stream. */
359+
setbuf(stdout, NULL);
360+
/* Also disable buffering for stderr because it's not guaranteed that it's
361+
* unbuffered on all systems. */
362+
setbuf(stderr, NULL);
363+
356364
printf("Exhaustive tests for order %lu\n", (unsigned long)EXHAUSTIVE_TEST_ORDER);
357365

358366
/* find iteration count */

0 commit comments

Comments
 (0)