X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Ftest-strstr.c;h=8a05e883758ff5f2d1a34d305357e907025aa59c;hb=35600a9a833bc287a025214c9601574e4a8115d7;hp=b03fcf9061e5650e27229068da3f6c3e4049568e;hpb=4cc1c913a03d9f6318453806494ca52ea3884d4a;p=gnulib.git diff --git a/tests/test-strstr.c b/tests/test-strstr.c index b03fcf906..8a05e8837 100644 --- a/tests/test-strstr.c +++ b/tests/test-strstr.c @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -29,6 +30,7 @@ if (!(expr)) \ { \ fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ abort (); \ } \ } \ @@ -42,6 +44,7 @@ main (int argc, char *argv[]) caused by SIGALRM. All known platforms that lack alarm also have a quadratic strstr, and the replacement strstr is known to not take too long. */ + signal (SIGALRM, SIG_DFL); alarm (50); #endif @@ -142,10 +145,8 @@ main (int argc, char *argv[]) result = strstr (haystack, needle); ASSERT (result == haystack + m); } - if (needle != NULL) - free (needle); - if (haystack != NULL) - free (haystack); + free (needle); + free (haystack); } /* Sublinear speed is only possible in memmem; strstr must examine