tests: randread-tests: use macro.h not "#define ASSERT..."
authorJim Meyering <meyering@redhat.com>
Tue, 8 Feb 2011 07:25:46 +0000 (08:25 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 8 Feb 2011 07:30:19 +0000 (08:30 +0100)
* gl/modules/randread-tests (Files): Add tests/macros.h
* gl/tests/test-rand-isaac.c: Remove now-unneeded #include directives.
(ASSERT): Remove definition.
Instead, include "macros.h".
Prompted by suggestions from Bruno Haible.

gl/modules/randread-tests
gl/tests/test-rand-isaac.c

index b608ac6..af24c90 100644 (file)
@@ -1,5 +1,6 @@
 Files:
 tests/test-rand-isaac.c
+tests/macros.h
 
 Depends-on:
 
index 83cd6bc..9dd7e2f 100644 (file)
 
 #include <fcntl.h>
 #include <stdint.h>
-#include <stdlib.h>
-#include <stdio.h>
 #include <string.h>
 
-/* FIXME: once/if in gnulib, use #include "macros.h" in place of this */
-#define ASSERT(expr) \
-  do                                                                         \
-    {                                                                        \
-      if (!(expr))                                                           \
-        {                                                                    \
-          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                   \
-          abort ();                                                          \
-        }                                                                    \
-    }                                                                        \
-  while (0)
+#include "macros.h"
 
 /* This expected output was generated by running the programs in
    <http://burtleburtle.net/bob/rand/isaacafa.html>, as last modified