projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reduce number of forks required during autoconf.
[gnulib.git]
/
tests
/
test-c-strcasestr.c
diff --git
a/tests/test-c-strcasestr.c
b/tests/test-c-strcasestr.c
index
683bfe7
..
e3ff0e2
100644
(file)
--- a/
tests/test-c-strcasestr.c
+++ b/
tests/test-c-strcasestr.c
@@
-1,5
+1,5
@@
/* Test of case-insensitive searching in a string.
/* Test of case-insensitive searching in a string.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007
, 2008
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
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
@@
-30,6
+30,7
@@
if (!(expr)) \
{ \
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
if (!(expr)) \
{ \
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+ fflush (stderr); \
abort (); \
} \
} \
abort (); \
} \
} \
@@
-62,6
+63,12
@@
main ()
ASSERT (result == NULL);
}
ASSERT (result == NULL);
}
+ {
+ const char input[] = "ABC ABCDAB ABCDABCDABDE";
+ const char *result = c_strcasestr (input, "ABCDaBCD");
+ ASSERT (result == input + 11);
+ }
+
/* Check that a very long haystack is handled quickly if the needle is
short and occurs near the beginning. */
{
/* Check that a very long haystack is handled quickly if the needle is
short and occurs near the beginning. */
{
@@
-130,10
+137,8
@@
main ()
result = c_strcasestr (haystack, needle);
ASSERT (result == haystack + m);
}
result = c_strcasestr (haystack, needle);
ASSERT (result == haystack + m);
}
- if (needle != NULL)
- free (needle);
- if (haystack != NULL)
- free (haystack);
+ free (needle);
+ free (haystack);
}
return 0;
}
return 0;