From 63e1b2aa7d396209aa5e26aa540d9593ede312a6 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 10 Sep 2020 09:09:15 -0700 Subject: [PATCH] Disable output buffering in tests_exhaustive.c --- src/tests_exhaustive.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tests_exhaustive.c b/src/tests_exhaustive.c index 34ee6bc..cfe9749 100644 --- a/src/tests_exhaustive.c +++ b/src/tests_exhaustive.c @@ -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 */