From dca1bd86337c078d39d9bb7e7bca0b450da7c4fd Mon Sep 17 00:00:00 2001 From: Andrew Nguyen Date: Wed, 13 Jan 2010 06:45:02 -0600 Subject: [PATCH] ntdll/tests: Add a few additional tests for wcschr. --- dlls/ntdll/tests/string.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/tests/string.c b/dlls/ntdll/tests/string.c index 16c11926016..f9b8665f12e 100644 --- a/dlls/ntdll/tests/string.c +++ b/dlls/ntdll/tests/string.c @@ -1113,10 +1113,21 @@ static void test_wtoi64(void) } } -static void test_wcsfuncs(void) +static void test_wcschr(void) +{ + static const WCHAR teststringW[] = {'a','b','r','a','c','a','d','a','b','r','a',0}; + + ok(p_wcschr(teststringW, 'a') == teststringW + 0, + "wcschr should have returned a pointer to the first 'a' character\n"); + ok(p_wcschr(teststringW, 0) == teststringW + 11, + "wcschr should have returned a pointer to the null terminator\n"); + ok(p_wcschr(teststringW, 'x') == NULL, + "wcschr should have returned NULL\n"); +} + +static void test_wcsrchr(void) { static const WCHAR testing[] = {'T','e','s','t','i','n','g',0}; - ok (p_wcschr(testing,0)!=NULL, "wcschr Not finding terminating character\n"); ok (p_wcsrchr(testing,0)!=NULL, "wcsrchr Not finding terminating character\n"); } @@ -1140,8 +1151,10 @@ START_TEST(string) test_wtol(); if (p_wtoi64) test_wtoi64(); - if (p_wcschr && p_wcsrchr) - test_wcsfuncs(); + if (p_wcschr) + test_wcschr(); + if (p_wcsrchr) + test_wcsrchr(); if (patoi) test_atoi(); if (patol) -- 2.11.4.GIT