ntdll(test): failure case for wcschr and wcsrchr

Aric Stewart aric at codeweavers.com
Tue Jul 12 09:58:51 CDT 2005


both wcschr and wcsrchr should be able to find the terminating 
character. This is a test case for that situation.
-------------- next part --------------
Index: dlls/ntdll/tests/string.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/tests/string.c,v
retrieving revision 1.9
diff -u -r1.9 string.c
--- dlls/ntdll/tests/string.c	27 Jun 2005 09:57:28 -0000	1.9
+++ dlls/ntdll/tests/string.c	12 Jul 2005 14:57:21 -0000
@@ -54,6 +54,8 @@
 static long     (WINAPIV *pwcstol)(LPCWSTR, LPWSTR *, INT);
 static ULONG    (WINAPIV *pwcstoul)(LPCWSTR, LPWSTR *, INT);
 
+static LPWSTR   (WINAPIV *p_wcschr)(LPCWSTR, WCHAR);
+static LPWSTR   (WINAPIV *p_wcsrchr)(LPCWSTR, WCHAR);
 
 static void InitFunctionPtrs(void)
 {
@@ -85,6 +87,9 @@
 
 	pwcstol = (void *)GetProcAddress(hntdll, "wcstol");
 	pwcstoul = (void *)GetProcAddress(hntdll, "wcstoul");
+
+	p_wcschr= (void *)GetProcAddress(hntdll, "wcschr");
+	p_wcsrchr= (void *)GetProcAddress(hntdll, "wcsrchr");
     } /* if */
 }
 
@@ -1063,6 +1068,12 @@
     } /* for */
 }
 
+static void test_wcsfuncs(void)
+{       
+    static const WCHAR testing[] = {'T','e','s','t','i','n','g',0};
+    ok (p_wcschr(testing,0x00000000)!=NULL, "wcschr Not finding terminating character\n");
+    ok (p_wcsrchr(testing,0x00000000)!=NULL, "wcsrchr Not finding terminating character\n");
+}
 
 START_TEST(string)
 {
@@ -1084,4 +1095,6 @@
         test_wtol();
     if (p_wtoi64)
         test_wtoi64();
+    if (p_wcschr && p_wcsrchr)
+        test_wcsfuncs();
 }


More information about the wine-patches mailing list