From: Jactry Zeng jzeng@codeweavers.com
--- dlls/msvcrt/tests/string.c | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
diff --git a/dlls/msvcrt/tests/string.c b/dlls/msvcrt/tests/string.c index c131c7d0442..58d8b0b5e3d 100644 --- a/dlls/msvcrt/tests/string.c +++ b/dlls/msvcrt/tests/string.c @@ -4808,6 +4808,52 @@ static void test_mbsrev(void) _setmbcp(cp); }
+static void test__tolower_l(void) +{ + int ret; + + if (!setlocale(LC_ALL, "english")) + { + win_skip("Skip _tolower_l tests.\n"); + return; + } + + ret = _tolower_l('\xa5', 0); + ok(ret == 165, "Got %d.\n", ret); + ret = _tolower_l('\xb9', 0); + ok(ret == 185, "Got %d.\n", ret); + ret = _tolower_l('a', 0); + ok(ret == 97, "Got %d.\n", ret); + + if (!setlocale(LC_ALL, ".936")) + { + win_skip("Skip _tolower_l tests.\n"); + return; + } + + ret = _tolower_l('\xa5', 0); + ok(ret == -91, "Got %d.\n", ret); + ret = _tolower_l('\xb9', 0); + ok(ret == -71, "Got %d.\n", ret); + ret = _tolower_l('a', 0); + ok(ret == 97, "Got %d.\n", ret); + + if (!setlocale(LC_ALL, "chinese-simplified")) + { + win_skip("Skip _tolower_l tests.\n"); + return; + } + + ret = _tolower_l('\xa5', 0); + ok(ret == -91, "Got %d.\n", ret); + ret = _tolower_l('\xb9', 0); + ok(ret == -71, "Got %d.\n", ret); + ret = _tolower_l('a', 0); + ok(ret == 97, "Got %d.\n", ret); + + setlocale(LC_ALL, "C"); +} + START_TEST(string) { char mem[100]; @@ -4970,4 +5016,5 @@ START_TEST(string) test__mbbtype(); test_wcsncpy(); test_mbsrev(); + test__tolower_l(); }