Better ASSERT macro.
[gnulib.git] / tests / test-argmatch.c
index c37fc5d..e61b88f 100644 (file)
 
 #include "argmatch.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "progname.h"
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 enum backup_type
 {