* tests/test-strstr.c (main): Add test of periodic needle.
* tests/test-strcasestr.c (main): Likewise.
* tests/test-c-strstr.c (main): Likewise.
* tests/test-c-strcasestr.c (main): Likewise.
* tests/test-memmem.c (main): Likewise.
+2023-03-27 Bruno Haible <bruno@clisp.org>
+
+ Add test case from a past musl libc bug.
+ * tests/test-strstr.c (main): Add test of periodic needle.
+ * tests/test-strcasestr.c (main): Likewise.
+ * tests/test-c-strstr.c (main): Likewise.
+ * tests/test-c-strcasestr.c (main): Likewise.
+ * tests/test-memmem.c (main): Likewise.
+
2023-03-27 Bruno Haible <bruno@clisp.org>
uchar: ISO C 23: Define char8_t.
free (haystack);
}
+ /* Test case from Yves Bastide.
+ <https://www.openwall.com/lists/musl/2014/04/18/2> */
+ {
+ const char input[] = "playing PLAY play PLAY always";
+ const char *result = c_strcasestr (input, "play PLAY play");
+ ASSERT (result == input + 8);
+ }
+
/* Test long needles. */
{
size_t m = 1024;
free (haystack);
}
+ /* Test case from Yves Bastide.
+ <https://www.openwall.com/lists/musl/2014/04/18/2> */
+ {
+ const char input[] = "playing play play play always";
+ const char *result = c_strstr (input, "play play play");
+ ASSERT (result == input + 8);
+ }
+
/* Test long needles. */
{
size_t m = 1024;
free (haystack);
}
+ /* Test case from Yves Bastide.
+ <https://www.openwall.com/lists/musl/2014/04/18/2> */
+ {
+ const char input[] = "playing play play play always";
+ const char *result = memmem (input, strlen (input), "play play play", 14);
+ ASSERT (result == input + 8);
+ }
+
/* Test long needles. */
{
size_t m = 1024;
free (haystack);
}
+ /* Test case from Yves Bastide.
+ <https://www.openwall.com/lists/musl/2014/04/18/2> */
+ {
+ const char input[] = "playing PLAY play PLAY always";
+ const char *result = strcasestr (input, "play PLAY play");
+ ASSERT (result == input + 8);
+ }
+
/* Test long needles. */
{
size_t m = 1024;
free (haystack);
}
+ /* Test case from Yves Bastide.
+ <https://www.openwall.com/lists/musl/2014/04/18/2> */
+ {
+ const char input[] = "playing play play play always";
+ const char *result = strstr (input, "play play play");
+ ASSERT (result == input + 8);
+ }
+
/* Test long needles. */
{
size_t m = 1024;