New module attribute 'Applicability'.
[gnulib.git] / tests / test-vasnprintf.c
index 72f1f95..280e1f4 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of vasnprintf() and asnprintf() functions.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 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 <string.h>
 
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 static char *
@@ -76,10 +77,10 @@ test_vasnprintf ()
       ASSERT (strcmp (result, "12345") == 0);
       ASSERT (length == 5);
       if (size < 6)
-       ASSERT (result != buf);
+        ASSERT (result != buf);
       ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
       if (result != buf)
-       free (result);
+        free (result);
     }
 }
 
@@ -111,10 +112,10 @@ test_asnprintf ()
       ASSERT (strcmp (result, "12345") == 0);
       ASSERT (length == 5);
       if (size < 6)
-       ASSERT (result != buf);
+        ASSERT (result != buf);
       ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
       if (result != buf)
-       free (result);
+        free (result);
     }
 }