Module: wine Branch: master Commit: d0319e20eb1903f6c6d7ac204a0d4785179eb765 URL: https://source.winehq.org/git/wine.git/?a=commit;h=d0319e20eb1903f6c6d7ac204...
Author: Jeff Smith whydoubt@gmail.com Date: Wed Nov 27 17:52:19 2019 +0100
ucrtbase: Expand tests for strftime format %g.
Signed-off-by: Jeff Smith whydoubt@gmail.com Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ucrtbase/tests/misc.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index 6314662eac..9b43d73559 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -927,7 +927,7 @@ static void test_strftime(void) const char *format; const char *ret; struct tm tm; - BOOL todo; + BOOL todo_value; BOOL todo_handler; } tests[] = { {"%C", "", { 0, 0, 0, 1, 0, -2000, 4, 0, 0 }}, @@ -974,26 +974,33 @@ static void test_strftime(void) {"%I", "11", { 0, 0, 23, 1, 0, 70, 4, 0, 0 }}, {"%I", "", { 0, 0, 24, 1, 0, 70, 4, 0, 0 }}, {"%n", "\n", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, - {"%r", "12:00:00 AM", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }, TRUE}, - {"%r", "02:00:00 PM", { 0, 0, 14, 1, 0, 121, 6, 0, 0 }, TRUE}, + {"%r", "12:00:00 AM", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }, TRUE, TRUE}, + {"%r", "02:00:00 PM", { 0, 0, 14, 1, 0, 121, 6, 0, 0 }, TRUE, TRUE}, {"%t", "\t", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%g", "", { 0, 0, 0, 1, 0, -1901, 4, 0, 0 }, TRUE}, + {"%g", "", { 0, 0, 0, 1, 0, -1901, 3, 364, 0 }, TRUE, TRUE}, + {"%g", "00", { 0, 0, 0, 1, 0, -1900, 4, 0, 0 }}, {"%g", "70", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%g", "71", { 0, 0, 0, 2, 0, 72, 0, 1, 0 }}, + {"%g", "72", { 0, 0, 0, 3, 0, 72, 1, 2, 0 }}, {"%g", "16", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }}, + {"%g", "99", { 0, 0, 0, 1, 0, 8099, 4, 0, 0 }}, + {"%g", "00", { 0, 0, 0, 1, 0, 8099, 3, 364, 0 }}, + {"%g", "", { 0, 0, 0, 1, 0, 8100, 0, 0, 0 }, TRUE, TRUE}, + {"%g", "", { 0, 0, 0, 1, 0, 8100, 4, 0, 0 }, TRUE, TRUE}, {"%G", "1970", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, + {"%G", "1971", { 0, 0, 0, 2, 0, 72, 0, 1, 0 }}, + {"%G", "1972", { 0, 0, 0, 3, 0, 72, 1, 2, 0 }}, {"%G", "2016", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }}, - {"%V", "01", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }, TRUE}, - {"%V", "52", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }, TRUE}, - {"%V", "53", { 0, 0, 14, 1, 0, 121, 6, 0, 0 }, TRUE}, + {"%V", "01", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }, TRUE, TRUE}, + {"%V", "52", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }, TRUE, TRUE}, + {"%V", "53", { 0, 0, 14, 1, 0, 121, 6, 0, 0 }, TRUE, TRUE}, {"%y", "", { 0, 0, 0, 0, 0, -1901, 0, 0, 0 }}, {"%y", "00", { 0, 0, 0, 0, 0, -1900, 0, 0, 0 }}, {"%y", "99", { 0, 0, 0, 0, 0, 8099, 0, 0, 0 }}, {"%y", "", { 0, 0, 0, 0, 0, 8100, 0, 0, 0 }}, - {"%g", "71", { 0, 0, 0, 2, 0, 72, 0, 1, 0 }}, - {"%g", "72", { 0, 0, 0, 3, 0, 72, 1, 2, 0 }}, - {"%G", "1971", { 0, 0, 0, 2, 0, 72, 0, 1, 0 }}, - {"%G", "1972", { 0, 0, 0, 3, 0, 72, 1, 2, 0 }}, - {"%c", "Thu Jan 1 00:00:00 1970", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }, TRUE}, - {"%c", "Thu Feb 30 00:00:00 1970", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }, TRUE}, + {"%c", "Thu Jan 1 00:00:00 1970", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }, TRUE, TRUE}, + {"%c", "Thu Feb 30 00:00:00 1970", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }, TRUE, TRUE}, {"%#c", "Thursday, January 01, 1970 00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, {"%#c", "Thursday, February 30, 1970 00:00:00", { 0, 0, 0, 30, 1, 70, 4, 0, 0 }}, {"%x", "01/01/70", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, @@ -1091,7 +1098,7 @@ static void test_strftime(void)
for (i=0; i<ARRAY_SIZE(tests); i++) { - todo_wine_if(tests[i].todo || tests[i].todo_handler) { + todo_wine_if(tests[i].todo_handler) { if (!tests[i].ret[0]) SET_EXPECT(global_invalid_parameter_handler); ret = p_strftime(buf, sizeof(buf), tests[i].format, &tests[i].tm); @@ -1099,7 +1106,7 @@ static void test_strftime(void) CHECK_CALLED(global_invalid_parameter_handler); }
- todo_wine_if(tests[i].todo) { + todo_wine_if(tests[i].todo_value) { ok(ret == strlen(tests[i].ret), "%d) ret = %d\n", i, ret); ok(!strcmp(buf, tests[i].ret), "%d) buf = "%s", expected "%s"\n", i, buf, tests[i].ret);