The nls files need regeneration, in order to get the test working.
-- v5: make_unicode: Add some fullwidth mapping exceptions.
From: Bernhard Kölbl bkoelbl@codeweavers.com
Signed-off-by: Bernhard Kölbl bkoelbl@codeweavers.com --- dlls/kernel32/tests/locale.c | 10 ++++++++++ tools/make_unicode | 4 ++++ 2 files changed, 14 insertions(+)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 825d6f95f62..0508af6652f 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -2841,6 +2841,16 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f ok(!ret, "%s func_ptr should fail with srclen = 0\n", func_name); ok(GetLastError() == ERROR_INVALID_PARAMETER, "%s unexpected error code %ld\n", func_name, GetLastError()); + + /* test for characters which don't get mapped to their + halfwidth counterparts on LCMAP_HALFWIDTH */ + for (i = 0x2190; i <= 0x21ff; ++i) + buf[i - 0x2190] = buf2[i - 0x2190] = i; + + buf[0x70] = buf2[0x70] = 0x25cb; + ret = func_ptr(LCMAP_HALFWIDTH, buf, 0x71, buf2, 0x71); + ok(ret == 0x71, "%s ret %#x, expected value 0x71\n", func_name, ret); + ok(!memcmp(buf, buf2, sizeof(WCHAR) * 0x71), "in- and output must be equal\n"); }
static INT LCMapStringW_wrapper(DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen) diff --git a/tools/make_unicode b/tools/make_unicode index cacc062b230..f07d2f5dc66 100755 --- a/tools/make_unicode +++ b/tools/make_unicode @@ -5318,6 +5318,10 @@ sub build_charmaps_data() $halfwidth_table[0x2019] = 0x0027; $halfwidth_table[0x201c] = 0x0022; $halfwidth_table[0x201d] = 0x0022; + foreach my $ch (0x2190..0x2193, 0x25cb) + { + $halfwidth_table[$ch] = $ch; + } $halfwidth_table[0x309b] = 0xff9e; $halfwidth_table[0x309c] = 0xff9f; $fullwidth_table[0x309b] = 0x3099;
From: Bernhard Kölbl bkoelbl@codeweavers.com
Signed-off-by: Bernhard Kölbl bkoelbl@codeweavers.com --- dlls/kernel32/tests/locale.c | 8 ++++++++ tools/make_unicode | 4 ++++ 2 files changed, 12 insertions(+)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 0508af6652f..b0354b586a8 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -2851,6 +2851,14 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f ret = func_ptr(LCMAP_HALFWIDTH, buf, 0x71, buf2, 0x71); ok(ret == 0x71, "%s ret %#x, expected value 0x71\n", func_name, ret); ok(!memcmp(buf, buf2, sizeof(WCHAR) * 0x71), "in- and output must be equal\n"); + + /* test the other way around */ + for (i = 0xffe9; i <= 0xffee; ++i) + buf[i - 0xffe9] = buf2[i - 0xffe9] = i; + + ret = func_ptr(LCMAP_FULLWIDTH, buf, 0x6, buf2, 0x6); + ok(ret == 0x6, "%s ret %#x, expected value 0x6\n", func_name, ret); + ok(!memcmp(buf, buf2, sizeof(WCHAR) * 0x6), "in- and output must be equal\n"); }
static INT LCMapStringW_wrapper(DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen) diff --git a/tools/make_unicode b/tools/make_unicode index f07d2f5dc66..f8b719dc0ed 100755 --- a/tools/make_unicode +++ b/tools/make_unicode @@ -5326,6 +5326,10 @@ sub build_charmaps_data() $halfwidth_table[0x309c] = 0xff9f; $fullwidth_table[0x309b] = 0x3099; $fullwidth_table[0x309c] = 0x309a; + foreach my $ch (0xffe9..0xffee) + { + $fullwidth_table[$ch] = $ch; + } $data .= dump_binary_case_table( @halfwidth_table ) . dump_binary_case_table( @fullwidth_table );
# LCMAP_TRADITIONAL/SIMPLIFIED_CHINESE
v4: Added full width mapping tests. (There are significantly fewer arrows in half width)