diff tests/test-striconveha.c @ 8754:1f57552cdb11

Better ASSERT macro.
author Bruno Haible <bruno@clisp.org>
date Sun, 29 Apr 2007 09:15:13 +0000
parents 14e648f874bb
children 633babea5f62
line wrap: on
line diff
--- a/tests/test-striconveha.c
+++ b/tests/test-striconveha.c
@@ -28,11 +28,21 @@
 #endif
 
 #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)
 
 /* Magic number for detecting bounds violations.  */
 #define MAGIC 0x1983EFF1