Merge branch 'upstream'
[gnulib.git] / tests / test-strchrnul.c
index fb26535..dc55066 100644 (file)
 #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
@@ -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;
+          }
       }
   }