From: Daniel Lehman dlehman25@gmail.com
--- dlls/msvcrt/tests/locale.c | 35 ++++++++++++++++++++++++++++++++ include/msvcrt/corecrt_wstring.h | 1 + 2 files changed, 36 insertions(+)
diff --git a/dlls/msvcrt/tests/locale.c b/dlls/msvcrt/tests/locale.c index ede9728517e..38dc62eb416 100644 --- a/dlls/msvcrt/tests/locale.c +++ b/dlls/msvcrt/tests/locale.c @@ -798,6 +798,40 @@ static void test___mb_cur_max_func(void) } }
+static void test__wcsicmp_l(void) +{ + const struct { + const wchar_t *str1; + const wchar_t *str2; + int exp; + const char *loc; + } tests[] = { + { L"i", L"i", 0 }, + { L"I", L"i", 0 }, + { L"I", L"i", 0, "Turkish" }, + { L"i", L"a", 8 }, + { L"a", L"i", -8 }, + { L"i", L"a", 8, "Turkish" }, + }; + int ret, i; + + for(i=0; i<ARRAY_SIZE(tests); i++) { + _locale_t loc = NULL; + + if(tests[i].loc && !(loc = _create_locale(LC_ALL, tests[i].loc))) { + win_skip("locale %s not available. skipping\n", tests[i].loc); + continue; + } + + ret = _wcsicmp_l(tests[i].str1, tests[i].str2, loc); + ok(ret == tests[i].exp, "_wcsicmp_l = %d, expected %d for test %d '%ls' vs '%ls' using %s locale\n", + ret, tests[i].exp, i, tests[i].str1, tests[i].str2, loc ? tests[i].loc : "current"); + + if(loc) + _free_locale(loc); + } +} + START_TEST(locale) { init(); @@ -806,4 +840,5 @@ START_TEST(locale) test_setlocale(); test__Gettnames(); test___mb_cur_max_func(); + test__wcsicmp_l(); } diff --git a/include/msvcrt/corecrt_wstring.h b/include/msvcrt/corecrt_wstring.h index 4d012800f65..02332787dc9 100644 --- a/include/msvcrt/corecrt_wstring.h +++ b/include/msvcrt/corecrt_wstring.h @@ -32,6 +32,7 @@ _ACRTIMP void* __cdecl memmove(void*,const void*,size_t);
_ACRTIMP wchar_t* __cdecl _wcsdup(const wchar_t*) __WINE_DEALLOC(free) __WINE_MALLOC; _ACRTIMP int __cdecl _wcsicmp(const wchar_t*,const wchar_t*); +_ACRTIMP int __cdecl _wcsicmp_l(const wchar_t*,const wchar_t*, _locale_t); _ACRTIMP int __cdecl _wcsicoll(const wchar_t*,const wchar_t*); _ACRTIMP int __cdecl _wcsicoll_l(const wchar_t*, const wchar_t*, _locale_t); _ACRTIMP wchar_t* __cdecl _wcslwr(wchar_t*);