mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-22 20:01:49 +00:00
Using mg_strcasestr() instead of strstr()
This commit is contained in:
1 parent
b809665cad
commit
0bd43bcae3
2 files changed
+27
-4
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user