bootstrap: fix handling of various perl --version formats
[gnulib.git] / tests / test-strchrnul.c
index fb26535..ea882e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Free Software Foundation
+ * Copyright (C) 2008, 2009 Free Software Foundation
  * Written by Eric Blake and Bruno Haible
  *
  * This program is free software: you can redistribute it and/or modify
 #define ASSERT(expr) \
   do                                                                        \
     {                                                                       \
-      if (!(expr))                                                          \
-       {                                                                    \
-         fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-         fflush (stderr);                                                   \
-         abort ();                                                          \
-       }                                                                    \
-    }                                                                       \
+      if (!(expr))                                                      \
+        {                                                               \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                              \
+          abort ();                                                     \
+        }                                                               \
+    }                                                                   \
   while (0)
 
 int
-main ()
+main (void)
 {
   size_t n = 0x100000;
   char *input = malloc (n + 1);
@@ -67,7 +67,7 @@ main ()
     size_t repeat = 10000;
     for (; repeat > 0; repeat--)
       {
-       ASSERT (strchrnul (input, 'c') == input + 2);
+        ASSERT (strchrnul (input, 'c') == input + 2);
       }
   }
 
@@ -76,15 +76,15 @@ main ()
     int i, j;
     for (i = 0; i < 32; i++)
       {
-       for (j = 0; j < 256; j++)
-         input[i + j] = (j + 1) & 0xff;
-       for (j = 1; j < 256; j++)
-         {
-           ASSERT (strchrnul (input + i, j) == input + i + j - 1);
-           input[i + j - 1] = (j == 1 ? 2 : 1);
-           ASSERT (strchrnul (input + i, j) == input + i + 255);
-           input[i + j - 1] = j;
-         }
+        for (j = 0; j < 256; j++)
+          input[i + j] = (j + 1) & 0xff;
+        for (j = 1; j < 256; j++)
+          {
+            ASSERT (strchrnul (input + i, j) == input + i + j - 1);
+            input[i + j - 1] = (j == 1 ? 2 : 1);
+            ASSERT (strchrnul (input + i, j) == input + i + 255);
+            input[i + j - 1] = j;
+          }
       }
   }