From d5a61d71c1fbd5eac54943515250b0cddd9ca7b3 Mon Sep 17 00:00:00 2001 From: Pekka Pessi Date: Mon, 31 Oct 2005 20:18:09 +0200 Subject: [PATCH] Fixed testcases not working with libc implementation. darcs-hash:20051031181809-65a35-f9816920a84000203e5e3e9d21ae79afa6d4416a.gz --- libsofia-sip-ua/su/test_memmem.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libsofia-sip-ua/su/test_memmem.c b/libsofia-sip-ua/su/test_memmem.c index 2f054409..67c1567e 100644 --- a/libsofia-sip-ua/su/test_memmem.c +++ b/libsofia-sip-ua/su/test_memmem.c @@ -31,8 +31,6 @@ * @author Pekka Pessi * * @date Created: Tue Aug 21 15:18:26 2001 ppessi - * - * @date Last modified: Wed Jul 20 20:36:00 2005 kaiv */ #include "config.h" @@ -68,6 +66,8 @@ void usage(void) static int test_notfound(void); static int test_pattern(void); +char const *null = NULL; + static int test_notfound(void) { char const haystack[12] = "abcabcabcabc"; @@ -78,9 +78,9 @@ static int test_notfound(void) TEST(memmem(haystack, sizeof haystack, needle, sizeof needle), haystack + 2); TEST(memmem(needle, sizeof needle, haystack, sizeof haystack), NULL); TEST(memmem(haystack, sizeof haystack, "", 0), haystack); - TEST(memmem(haystack, sizeof haystack, NULL, 0), haystack); + TEST(memmem(haystack, sizeof haystack, null, 0), haystack); TEST(memmem(haystack, 0, "", 0), haystack); - TEST(memmem(haystack, 0, NULL, 0), haystack); + TEST(memmem(haystack, 0, null, 0), haystack); TEST(memmem(haystack + 2, 3, needle, 3), haystack + 2); TEST(memmem(a = "a\0bc", 4, "a\0bc", 4), a); @@ -129,8 +129,8 @@ int test_strcasestr(void) /* Special cases */ TEST_1(strcasestr(hs, "") == hs); - TEST_1(strcasestr(NULL, "ong") == NULL); - TEST_1(strcasestr(NULL, "OnG") == NULL); + TEST_1(strcasestr("", "ong") == NULL); + TEST_1(strcasestr("", "OnG") == NULL); TEST_1(strcasestr("ong", hs) == NULL); TEST_1(strcasestr("OnG", hs) == NULL); TEST_1(strcasestr(hs, "Z") == NULL); -- GitLab