tests: avoid spurious assertion failure in test-float.c on ppc64
[gnulib.git] / tests / unictype / test-numeric.c
index 5bca363..d602383 100644 (file)
@@ -1,5 +1,5 @@
 /* Test the Unicode character type functions.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+   Copyright (C) 2007-2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #include "unictype.h"
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
-          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
-  while (0)
-#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
+#include "macros.h"
 
 static const struct { unsigned int ch; int numerator; int denominator; }
   mapping[] =
@@ -52,14 +39,14 @@ main ()
   for (i = 0; i < SIZEOF (mapping); i++)
     {
       for (; c < mapping[i].ch; c++)
-       {
-         value = uc_numeric_value (c);
-         ASSERT (value.numerator == 0 && value.denominator == 0);
-       }
+        {
+          value = uc_numeric_value (c);
+          ASSERT (value.numerator == 0 && value.denominator == 0);
+        }
       /* Here c = mapping[i].ch.  */
       value = uc_numeric_value (c);
       ASSERT (value.numerator == mapping[i].numerator
-             && value.denominator == mapping[i].denominator);
+              && value.denominator == mapping[i].denominator);
       c++;
     }
   for (; c < 0x110000; c++)