X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-strstr.c;h=1482e7de820196828a79807a94712d68c1717b3c;hb=880d107;hp=c89a1ace41495d58e627133bef5bf69f09465000;hpb=441aa3044f43e5572f58c354f01e6bc070acd5c7;p=gnulib.git diff --git a/tests/test-strstr.c b/tests/test-strstr.c index c89a1ace4..1482e7de8 100644 --- a/tests/test-strstr.c +++ b/tests/test-strstr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2007, 2008, 2009 Free Software Foundation + * Copyright (C) 2004, 2007-2010 Free Software Foundation, Inc. * Written by Bruno Haible and Eric Blake * * This program is free software: you can redistribute it and/or modify @@ -19,24 +19,15 @@ #include +#include "signature.h" +SIGNATURE_CHECK (strstr, char *, (char const *, char const *)); + #include -#include #include #include #include "zerosize-ptr.h" - -#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 (int argc, char *argv[]) @@ -105,7 +96,7 @@ main (int argc, char *argv[]) { size_t repeat = 10000; size_t m = 1000000; - char *needle = + const char *needle = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; char *haystack = (char *) malloc (m + 1); @@ -129,7 +120,7 @@ main (int argc, char *argv[]) { size_t repeat = 10000; size_t m = 1000000; - char *haystack = + const char *haystack = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" "ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB"; char *needle = (char *) malloc (m + 1);