Better ASSERT macro.
[gnulib.git] / tests / uniconv / test-u16-strconv-to-enc.c
index c8b9df0..35a8eb7 100644 (file)
 #include "uniconv.h"
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()