Flush the standard error stream before aborting.
[gnulib.git] / tests / test-func.c
index 7b49026..e55fcd5 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr)                                                   \
-  do                                                                   \
-    {                                                                  \
-      if (!(expr))                                                     \
-       {                                                               \
+#define ASSERT(expr)                                                        \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+       {                                                                    \
          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-         abort ();                                                     \
-       }                                                               \
-    }                                                                  \
+         fflush (stderr);                                                   \
+         abort ();                                                          \
+       }                                                                    \
+    }                                                                       \
   while (0)
 
 int