X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-strchrnul.c;h=dc550661b47441f07c3b0592392b0e47850e5ed1;hb=9cedf3e1ac7dbdddefb7e172156e9000de7d80c2;hp=fb26535e55d6477a617b068895818052229559ae;hpb=d2a45d9a8b6d045041db52a37fc7e1226d12deec;p=gnulib.git diff --git a/tests/test-strchrnul.c b/tests/test-strchrnul.c index fb26535e5..dc550661b 100644 --- a/tests/test-strchrnul.c +++ b/tests/test-strchrnul.c @@ -25,13 +25,13 @@ #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; + } } }