From: Jeff Smith Subject: [PATCH 2/3] shlwapi/tests: Test what IsCharBlankW considers a blank character. Message-Id: <20200101074616.2138678-2-whydoubt@gmail.com> Date: Wed, 1 Jan 2020 01:46:15 -0600 In-Reply-To: <20200101074616.2138678-1-whydoubt@gmail.com> References: <20200101074616.2138678-1-whydoubt@gmail.com> Signed-off-by: Jeff Smith --- dlls/shlwapi/tests/string.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/shlwapi/tests/string.c b/dlls/shlwapi/tests/string.c index 9114ad88e1..40753dd431 100644 --- a/dlls/shlwapi/tests/string.c +++ b/dlls/shlwapi/tests/string.c @@ -68,6 +68,7 @@ static INT (WINAPIV *pwnsprintfW)(LPWSTR,INT,LPCWSTR, ...); static LPWSTR (WINAPI *pStrChrNW)(LPCWSTR,WCHAR,UINT); static BOOL (WINAPI *pStrToInt64ExA)(LPCSTR,DWORD,LONGLONG*); static BOOL (WINAPI *pStrToInt64ExW)(LPCWSTR,DWORD,LONGLONG*); +static BOOL (WINAPI *pIsCharBlankW)(WCHAR); static int strcmpW(const WCHAR *str1, const WCHAR *str2) { @@ -1620,6 +1621,19 @@ static void test_StrCatChainW(void) ok(buf[5] == 'e', "Expected buf[5] = 'e', got %x\n", buf[5]); } +static void test_IsCharBlankW(void) +{ + int c; + + for (c = 0; c <= 0xffff; c++) + { + if(c == '\t' || c == ' ' || c == 0xa0 || c == 0x3000 || c == 0xfeff) + ok(pIsCharBlankW(c), "%d should be blank\n", c); + else + ok(!pIsCharBlankW(c), "%d shouldn't be blank\n", c); + } +} + START_TEST(string) { HMODULE hShlwapi; @@ -1659,6 +1673,7 @@ START_TEST(string) pwnsprintfW = (void *)GetProcAddress(hShlwapi, "wnsprintfW"); pStrToInt64ExA = (void *)GetProcAddress(hShlwapi, "StrToInt64ExA"); pStrToInt64ExW = (void *)GetProcAddress(hShlwapi, "StrToInt64ExW"); + pIsCharBlankW = (void *)GetProcAddress(hShlwapi, (LPSTR)30); test_StrChrA(); test_StrChrW(); @@ -1707,5 +1722,7 @@ START_TEST(string) test_StrStrNIW(); test_StrCatChainW(); + test_IsCharBlankW(); + CoUninitialize(); } -- 2.23.0