Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/ucrtbase/tests/misc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index f637997a0d..6b5977c4d8 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -154,6 +154,7 @@ static MSVCRT_lldiv_t* (CDECL *p_lldiv)(MSVCRT_lldiv_t*,LONGLONG,LONGLONG); static int (CDECL *p__isctype)(int,int); static int (CDECL *p_isblank)(int); static int (CDECL *p__isblank_l)(int,_locale_t); +static int (CDECL *p_iswctype)(int,int); static int (CDECL *p__iswctype_l)(int,int,_locale_t); static int (CDECL *p_iswblank)(int); static int (CDECL *p__iswblank_l)(wint_t,_locale_t); @@ -531,6 +532,7 @@ static BOOL init(void) p__isctype = (void*)GetProcAddress(module, "_isctype"); p_isblank = (void*)GetProcAddress(module, "isblank"); p__isblank_l = (void*)GetProcAddress(module, "_isblank_l"); + p_iswctype = (void*)GetProcAddress(module, "iswctype"); p__iswctype_l = (void*)GetProcAddress(module, "_iswctype_l"); p_iswblank = (void*)GetProcAddress(module, "iswblank"); p__iswblank_l = (void*)GetProcAddress(module, "_iswblank_l"); @@ -646,14 +648,18 @@ static void test_isblank(void)
for(c = 0; c <= 0xffff; c++) { if(c == '\t' || c == ' ' || c == 0x3000 || c == 0xfeff) { - if(c == '\t') + if(c == '\t') { + todo_wine ok(!p_iswctype(c, _BLANK), "tab shouldn't be blank\n", c); todo_wine ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n"); - else + } else { + ok(p_iswctype(c, _BLANK), "%d should be blank\n", c); ok(p__iswctype_l(c, _BLANK, NULL), "%d should be blank\n", c); + } ok(p_iswblank(c), "%d should be blank\n", c); ok(p__iswblank_l(c, NULL), "%d should be blank\n", c); } else { todo_wine_if(c == 0xa0) { + ok(!p_iswctype(c, _BLANK), "%d shouldn't be blank\n", c); ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c); ok(!p_iswblank(c), "%d shouldn't be blank\n", c); ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c);
Signed-off-by: Jeff Smith whydoubt@gmail.com --- 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(); }
Keep them marked as blank in wctype_table (used by IsCharBlankW) though.
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/ucrtbase/tests/misc.c | 14 ++++++-------- libs/port/wctype.c | 4 ++-- tools/make_unicode | 5 ++++- 3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index 6b5977c4d8..2accee2dac 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -649,8 +649,8 @@ static void test_isblank(void) for(c = 0; c <= 0xffff; c++) { if(c == '\t' || c == ' ' || c == 0x3000 || c == 0xfeff) { if(c == '\t') { - todo_wine ok(!p_iswctype(c, _BLANK), "tab shouldn't be blank\n", c); - todo_wine ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n"); + ok(!p_iswctype(c, _BLANK), "tab shouldn't be blank\n", c); + ok(!p__iswctype_l(c, _BLANK, NULL), "tab shouldn't be blank\n"); } else { ok(p_iswctype(c, _BLANK), "%d should be blank\n", c); ok(p__iswctype_l(c, _BLANK, NULL), "%d should be blank\n", c); @@ -658,12 +658,10 @@ static void test_isblank(void) ok(p_iswblank(c), "%d should be blank\n", c); ok(p__iswblank_l(c, NULL), "%d should be blank\n", c); } else { - todo_wine_if(c == 0xa0) { - ok(!p_iswctype(c, _BLANK), "%d shouldn't be blank\n", c); - ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c); - ok(!p_iswblank(c), "%d shouldn't be blank\n", c); - ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c); - } + ok(!p_iswctype(c, _BLANK), "%d shouldn't be blank\n", c); + ok(!p__iswctype_l(c, _BLANK, NULL), "%d shouldn't be blank\n", c); + ok(!p_iswblank(c), "%d shouldn't be blank\n", c); + ok(!p__iswblank_l(c, NULL), "%d shouldn't be blank\n", c); } } } diff --git a/libs/port/wctype.c b/libs/port/wctype.c index 5439e7db57..8c4dff4479 100644 --- a/libs/port/wctype.c +++ b/libs/port/wctype.c @@ -40,7 +40,7 @@ const unsigned short wine_wctype_table[17152] = 0x2800, 0x1200, 0x3d00, 0x3e00, 0x3f00, 0x4000, 0x4100, 0x4200, /* values */ 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, - 0xe220, 0x9268, 0x8228, 0x9228, 0xa228, 0x8228, 0xe220, 0xe220, + 0xe220, 0x9228, 0x8228, 0x9228, 0xa228, 0x8228, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0x8220, 0x8220, 0x8220, 0x9220, 0xa248, 0xb210, 0xb210, 0x5210, 0x5210, 0x5210, 0xb210, 0xb210, @@ -59,7 +59,7 @@ const unsigned short wine_wctype_table[17152] = 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, - 0x7248, 0xb210, 0x5210, 0x5210, 0x5210, 0x5210, 0xb210, 0xb210, + 0x7208, 0xb210, 0x5210, 0x5210, 0x5210, 0x5210, 0xb210, 0xb210, 0xb210, 0xb210, 0x1310, 0xb210, 0xb210, 0xe230, 0xb210, 0xb210, 0x5210, 0x5210, 0x3214, 0x3214, 0xb210, 0x1312, 0xb210, 0xb210, 0xb210, 0x3214, 0x1310, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, diff --git a/tools/make_unicode b/tools/make_unicode index 1aaeff38a4..fe426b1315 100755 --- a/tools/make_unicode +++ b/tools/make_unicode @@ -299,7 +299,7 @@ my %special_categories = "xdigit" => [ ord('0')..ord('9'),ord('A')..ord('F'),ord('a')..ord('f'), 0xff10..0xff19, 0xff21..0xff26, 0xff41..0xff46 ], "space" => [ 0x09..0x0d, 0x85 ], - "blank" => [ 0x09, 0x20, 0xa0, 0x3000, 0xfeff ], + "blank" => [ 0x20, 0x3000, 0xfeff ], "cntrl" => [ 0x070f, 0x200c, 0x200d, 0x200e, 0x200f, 0x202a, 0x202b, 0x202c, 0x202d, 0x202e, 0x206a, 0x206b, 0x206c, 0x206d, 0x206e, 0x206f, 0xfeff, @@ -2255,6 +2255,9 @@ sub dump_string_type_table($)
my @table = @category_table;
+ $table[0x09] |= $ctype{"blank"}; + $table[0xa0] |= $ctype{"blank"}; + # add the direction in the high 4 bits of the category for (my $i = 0; $i < 65536; $i++) {
This also needs to test other CRT libraries, ntdll and kernel32/kernelbase exports, or do we have that somehow covered already?
Hi Nikolay,
On Thu, Jan 2, 2020 at 4:13 AM Nikolay Sivov nsivov@codeweavers.com wrote:
This also needs to test other CRT libraries, ntdll and kernel32/kernelbase exports, or do we have that somehow covered already?
I am looking into expanding tests for the other CRT libraries and ntdll. While kernel32 doesn't export these, shlwapi does have some noname functions for checking character classes, such as IsBlankCharW (which I added testing for in this series).
Thanks, Jeff
On 1/2/20 8:46 PM, Jeff Smith wrote:
Hi Nikolay,
On Thu, Jan 2, 2020 at 4:13 AM Nikolay Sivov nsivov@codeweavers.com wrote:
This also needs to test other CRT libraries, ntdll and kernel32/kernelbase exports, or do we have that somehow covered already?
I am looking into expanding tests for the other CRT libraries and ntdll. While kernel32 doesn't export these, shlwapi does have some noname functions for checking character classes, such as IsBlankCharW (which I added testing for in this series).
Does it not affect GetStringType()?
Thanks, Jeff
Hi Jeff,
On 1/1/20 8:46 AM, Jeff Smith wrote:
todo_wine ok(!p_iswctype(c, _BLANK), "tab shouldn't be blank\n", c);
This line will produce compilation warning.
In case of msvc*/ucrtbase dlls the function should use _pwctype table.
Thanks, Piotr
Hi Piotr,
On Thu, Jan 2, 2020 at 7:56 AM Piotr Caban piotr.caban@gmail.com wrote:
In case of msvc*/ucrtbase dlls the function should use _pwctype table.
OK, I will investigate that table, as Wine doesn't appear to be using it currently.
Thanks, Jeff
This set was superseded by the set starting at https://source.winehq.org/patches/data/176495 (which I will revisit after code freeze).
On Thu, Jan 2, 2020 at 11:18 AM Jeff Smith whydoubt@gmail.com wrote:
Hi Piotr,
On Thu, Jan 2, 2020 at 7:56 AM Piotr Caban piotr.caban@gmail.com wrote:
In case of msvc*/ucrtbase dlls the function should use _pwctype table.
OK, I will investigate that table, as Wine doesn't appear to be using it currently.
Thanks, Jeff