Commit e6a42874 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

msvcrt/tests: Test .{O|A}CP locale string.

Used by Marvel's Avengers. Signed-off-by: 's avatarPaul Gofman <pgofman@codeweavers.com> Signed-off-by: 's avatarPiotr Caban <piotr@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent dc117553
......@@ -45,6 +45,8 @@ static void test_setlocale(void)
"LC_MONETARY=Greek_Greece.1253;LC_NUMERIC=Polish_Poland.1250;LC_TIME=C";
char *ret, buf[100];
char *ptr;
int len;
ret = setlocale(20, "C");
ok(ret == NULL, "ret = %s\n", ret);
......@@ -612,6 +614,27 @@ static void test_setlocale(void)
ok(!strcmp(ret, buf), "ret = %s, expected %s\n", ret, buf);
}
GetLocaleInfoA(GetUserDefaultLCID(), LOCALE_IDEFAULTCODEPAGE, buf, sizeof(buf));
if(IsValidCodePage(atoi(buf))) {
ret = setlocale(LC_ALL, ".OCP");
ok(ret != NULL, "ret == NULL\n");
ptr = strchr(ret, '.');
ok(ptr && !strcmp(ptr + 1, buf), "ret %s, buf %s.\n", ret, buf);
}
len = GetLocaleInfoA(GetUserDefaultLCID(), LOCALE_IDEFAULTANSICODEPAGE, buf, sizeof(buf)) - 1;
if(buf[0] == '0' && !buf[1])
len = sprintf(buf, "%d", GetACP());
ret = setlocale(LC_ALL, ".ACP");
ok(ret != NULL, "ret == NULL\n");
ptr = strchr(ret, '.');
ok(ptr && !strncmp(ptr + 1, buf, len), "ret %s, buf %s.\n", ret, buf);
ret = setlocale(LC_ALL, ".1250");
ok(ret != NULL, "ret == NULL\n");
ptr = strchr(ret, '.');
ok(ptr && !strcmp(ptr, ".1250"), "ret %s, buf %s.\n", ret, buf);
ret = setlocale(LC_ALL, "English_United States.UTF8");
ok(ret == NULL, "ret != NULL\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment