X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-mbsstr1.c;h=1e6f7e01fc99fe7732fdbac762da2610a7b304f9;hb=cd56634a4a8179fd5a4419fbb3e27211b042ab1c;hp=23e1dbec09c044ba28b1dba663af80ce00c86b1c;hpb=2d4d7d9d00fe33b6f5291e00a30b6c1016775b74;p=gnulib.git diff --git a/tests/test-mbsstr1.c b/tests/test-mbsstr1.c index 23e1dbec0..1e6f7e01f 100644 --- a/tests/test-mbsstr1.c +++ b/tests/test-mbsstr1.c @@ -1,5 +1,5 @@ /* Test of searching in a string. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2014 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 @@ -20,20 +20,9 @@ #include -#include #include -#define ASSERT(expr) \ - do \ - { \ - if (!(expr)) \ - { \ - fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ - fflush (stderr); \ - abort (); \ - } \ - } \ - while (0) +#include "macros.h" int main () @@ -69,7 +58,7 @@ main () { size_t repeat = 10000; size_t m = 1000000; - char *needle = + const char *needle = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; char *haystack = (char *) malloc (m + 1); @@ -93,7 +82,7 @@ main () { size_t repeat = 10000; size_t m = 1000000; - char *haystack = + const char *haystack = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB"; char *needle = (char *) malloc (m + 1);