libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

commit d83aea3a698a261c05c122882e84a96a01e75ce3
parent 071617a4f889c17332b768203e0aba131b0df61d
Author: Evgeny Grin <k2k@drgrin.dev>
Date:   Sun,  4 May 2025 11:26:06 +0300

test_lib_info_version: improved reporting

Diffstat:
Msrc/tests/basic/test_lib_info_version.c | 21++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/tests/basic/test_lib_info_version.c b/src/tests/basic/test_lib_info_version.c @@ -32,6 +32,14 @@ /* Helpers */ +static void +flush_std_all (void) +{ + fflush (stdout); + fflush (stderr); +} + + #define ERR_PRINT_LINE() \ ((void) fprintf (stderr, "At the line number %u: ", \ (unsigned) __LINE__)) @@ -52,6 +60,7 @@ tst_EXPECT_OK_helper (enum MHD_StatusCode code, line_num, expression, (unsigned long) code); + flush_std_all (); return 0; } @@ -208,11 +217,11 @@ test_macro_vs_func_bin (void) "MHD_lib_get_info_ver_num() function.\n"); if (bin_macro != bin_func) { - fprintf (stderr, "'0x%08lu' vs '0x%08lX' - FAILED.\n", + fprintf (stderr, "'0x%08lX' vs '0x%08lX' - FAILED.\n", (unsigned long) bin_macro, (unsigned long) bin_func); return 1; } - printf ("'0x%08lu' vs '0x%08lX' - success.\n", + printf ("'0x%08lX' vs '0x%08lX' - success.\n", (unsigned long) bin_macro, (unsigned long) bin_func); return 0; } @@ -310,11 +319,17 @@ main (int argc, char *argv[]) (void) argc; (void) argv; /* Unused. Silence compiler warning. */ num_err = test_macro1_vs_macro2_str (); + flush_std_all (); num_err += test_macro2_vs_func_str (); + flush_std_all (); + num_err += test_func_str_format (); + flush_std_all (); num_err += test_func_str_vs_macro_bin (); + flush_std_all (); num_err += test_macro_vs_func_bin (); + flush_std_all (); num_err += test_func_bin_format (); - num_err += test_func_str_format (); + flush_std_all (); if (0 != num_err) {