Using mg_strcasestr() instead of strstr()

This commit is contained in:
Sergey Lyubka
2013-02-16 14:17:38 +00:00
parent b809665cad
commit 0bd43bcae3
2 changed files with 27 additions and 4 deletions
+10
View File
@@ -589,7 +589,17 @@ static void test_url_decode(void) {
ASSERT(strcmp(buf, "a ") == 0);
}
static void test_mg_strcasestr(void) {
static const char *big1 = "abcdef";
ASSERT(mg_strcasestr("Y", "X") == NULL);
ASSERT(mg_strcasestr("Y", "y") != NULL);
ASSERT(mg_strcasestr(big1, "X") == NULL);
ASSERT(mg_strcasestr(big1, "CD") == big1 + 2);
ASSERT(mg_strcasestr("aa", "AAB") == NULL);
}
int __cdecl main(void) {
test_mg_strcasestr();
test_alloc_vprintf();
test_base64_encode();
test_match_prefix();