Disable output buffering in tests_exhaustive.c

This commit is contained in:
Pieter Wuille 2020-09-10 09:09:15 -07:00
parent 39f67dd072
commit 63e1b2aa7d
1 changed files with 8 additions and 0 deletions

View File

@ -353,6 +353,14 @@ int main(int argc, char** argv) {
unsigned char rand32[32];
secp256k1_context *ctx;
/* Disable buffering for stdout to improve reliability of getting
* diagnostic information. Happens right at the start of main because
* setbuf must be used before any other operation on the stream. */
setbuf(stdout, NULL);
/* Also disable buffering for stderr because it's not guaranteed that it's
* unbuffered on all systems. */
setbuf(stderr, NULL);
printf("Exhaustive tests for order %lu\n", (unsigned long)EXHAUSTIVE_TEST_ORDER);
/* find iteration count */