Lines Matching refs:haystack
65 /* Check that a very long haystack is handled quickly if the needle is
73 char *haystack = (char *) malloc (m + 1);
74 if (haystack != NULL)
76 memset (haystack, 'A', m);
77 haystack[0] = 'B';
78 haystack[m] = '\0';
82 ASSERT (c_strstr (haystack, needle) == haystack + 1);
85 free (haystack);
89 /* Check that a very long needle is discarded quickly if the haystack is
94 char *haystack =
105 ASSERT (c_strstr (haystack, needle) == NULL);
115 char *haystack = (char *) malloc (2 * m + 2);
117 if (haystack != NULL && needle != NULL)
121 memset (haystack, 'A', 2 * m);
122 haystack[2 * m] = 'B';
123 haystack[2 * m + 1] = '\0';
129 result = c_strstr (haystack, needle);
130 ASSERT (result == haystack + m);
134 if (haystack != NULL)
135 free (haystack);