Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/ucrtbase/tests/misc.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index 6314662eac..8c9fc1acb0 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -929,6 +929,7 @@ static void test_strftime(void) struct tm tm; BOOL todo; BOOL todo_handler; + const char *broken; } tests[] = { {"%C", "", { 0, 0, 0, 1, 0, -2000, 4, 0, 0 }}, {"%C", "", { 0, 0, 0, 1, 0, -1901, 4, 0, 0 }}, @@ -977,9 +978,21 @@ static void test_strftime(void) {"%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}, {"%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}, + {"%g", "", { 0, 0, 0, 1, 0, -1900, 0, 0, 0 }, TRUE, FALSE, "0/" }, + {"%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}, + {"%g", "", { 0, 0, 0, 1, 0, 8100, 4, 0, 0 }, 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}, @@ -988,10 +1001,6 @@ static void test_strftime(void) {"%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", "Thursday, January 01, 1970 00:00:00", { 0, 0, 0, 1, 0, 70, 4, 0, 0 }}, @@ -1092,16 +1101,20 @@ static void test_strftime(void) for (i=0; i<ARRAY_SIZE(tests); i++) { todo_wine_if(tests[i].todo || tests[i].todo_handler) { - if (!tests[i].ret[0]) + if (!tests[i].ret[0] || (tests[i].broken && !tests[i].broken[0])) SET_EXPECT(global_invalid_parameter_handler); ret = p_strftime(buf, sizeof(buf), tests[i].format, &tests[i].tm); - if (!tests[i].ret[0]) + if (!tests[i].ret[0] && !tests[i].broken) CHECK_CALLED(global_invalid_parameter_handler); }
todo_wine_if(tests[i].todo) { - ok(ret == strlen(tests[i].ret), "%d) ret = %d\n", i, ret); - ok(!strcmp(buf, tests[i].ret), "%d) buf = "%s", expected "%s"\n", + ok(ret == strlen(tests[i].ret) || + broken(tests[i].broken && ret == strlen(tests[i].broken)), + "%d) ret = %d\n", i, ret); + ok(!strcmp(buf, tests[i].ret) || + broken(tests[i].broken && !strcmp(buf, tests[i].broken)), + "%d) buf = "%s", expected "%s"\n", i, buf, tests[i].ret); } }
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/msvcrt/time.c | 17 +++++++++++------ dlls/ucrtbase/tests/misc.c | 10 +++++----- 2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 0d5b64a4aa..50e571540f 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1195,6 +1195,9 @@ static MSVCRT_size_t strftime_impl(STRFTIME_CHAR *str, MSVCRT_size_t max, { MSVCRT_size_t ret, tmp; BOOL alternate; +#if _MSVCR_VER>=140 + int tmp_year; +#endif int year = mstm ? mstm->tm_year + 1900 : -1;
if(!str || !format) { @@ -1323,17 +1326,19 @@ static MSVCRT_size_t strftime_impl(STRFTIME_CHAR *str, MSVCRT_size_t max, break; case 'g': case 'G': - tmp = year; + if(!MSVCRT_CHECK_PMT(year>=0 && year<=9999)) + goto einval_error; + tmp_year = year; if (mstm->tm_yday - (mstm->tm_wday ? mstm->tm_wday : 7) + 4 < 0) - tmp--; - else if(mstm->tm_yday - (mstm->tm_wday ? mstm->tm_wday : 7) + 5 > 365 + IsLeapYear(tmp)) - tmp++; + tmp_year--; + else if(mstm->tm_yday - (mstm->tm_wday ? mstm->tm_wday : 7) + 5 > 365 + IsLeapYear(tmp_year)) + tmp_year++; if(*format == 'G') { - if (!strftime_int(str, &ret, max, tmp, 4, 0, 9999)) + if (!strftime_int(str, &ret, max, tmp_year, 4, 0, 9999)) return 0; } else { - if (!strftime_int(str, &ret, max, tmp%100, 2, 0, 99)) + if (!strftime_int(str, &ret, max, tmp_year%100, 2, 0, 99)) return 0; } break; diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index 8c9fc1acb0..a33742e9c1 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -978,9 +978,9 @@ static void test_strftime(void) {"%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}, {"%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}, - {"%g", "", { 0, 0, 0, 1, 0, -1900, 0, 0, 0 }, TRUE, FALSE, "0/" }, + {"%g", "", { 0, 0, 0, 1, 0, -1901, 4, 0, 0 }}, + {"%g", "", { 0, 0, 0, 1, 0, -1901, 3, 364, 0 }}, + {"%g", "", { 0, 0, 0, 1, 0, -1900, 0, 0, 0 }, FALSE, FALSE, "0/" }, {"%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 }}, @@ -988,8 +988,8 @@ static void test_strftime(void) {"%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}, - {"%g", "", { 0, 0, 0, 1, 0, 8100, 4, 0, 0 }, TRUE}, + {"%g", "", { 0, 0, 0, 1, 0, 8100, 0, 0, 0 }}, + {"%g", "", { 0, 0, 0, 1, 0, 8100, 4, 0, 0 }}, {"%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 }},
Hi Jeff,
Could you please rename the tmp_year to something more informative? It's only used to store the ISO 8601 week based year now. Also I would move its declaration to: case 'G': { int iso_year; ... } It's not going to be used anywhere else (taking into account patch 4).
Thanks, Piotr
On 11/26/19 7:00 AM, Jeff Smith wrote:
Signed-off-by: Jeff Smith whydoubt@gmail.com
dlls/msvcrt/time.c | 17 +++++++++++------ dlls/ucrtbase/tests/misc.c | 10 +++++----- 2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 0d5b64a4aa..50e571540f 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1195,6 +1195,9 @@ static MSVCRT_size_t strftime_impl(STRFTIME_CHAR *str, MSVCRT_size_t max, { MSVCRT_size_t ret, tmp; BOOL alternate; +#if _MSVCR_VER>=140
- int tmp_year;
+#endif int year = mstm ? mstm->tm_year + 1900 : -1;
if(!str || !format) {
@@ -1323,17 +1326,19 @@ static MSVCRT_size_t strftime_impl(STRFTIME_CHAR *str, MSVCRT_size_t max, break; case 'g': case 'G':
tmp = year;
if(!MSVCRT_CHECK_PMT(year>=0 && year<=9999))
goto einval_error;
tmp_year = year; if (mstm->tm_yday - (mstm->tm_wday ? mstm->tm_wday : 7) + 4 < 0)
tmp--;
else if(mstm->tm_yday - (mstm->tm_wday ? mstm->tm_wday : 7) + 5 > 365 + IsLeapYear(tmp))
tmp++;
tmp_year--;
else if(mstm->tm_yday - (mstm->tm_wday ? mstm->tm_wday : 7) + 5 > 365 + IsLeapYear(tmp_year))
tmp_year++; if(*format == 'G') {
if (!strftime_int(str, &ret, max, tmp, 4, 0, 9999))
if (!strftime_int(str, &ret, max, tmp_year, 4, 0, 9999)) return 0; } else {
if (!strftime_int(str, &ret, max, tmp%100, 2, 0, 99))
if (!strftime_int(str, &ret, max, tmp_year%100, 2, 0, 99)) return 0; } break;
diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index 8c9fc1acb0..a33742e9c1 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -978,9 +978,9 @@ static void test_strftime(void) {"%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}, {"%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},
{"%g", "", { 0, 0, 0, 1, 0, -1900, 0, 0, 0 }, TRUE, FALSE, "0/" },
{"%g", "", { 0, 0, 0, 1, 0, -1901, 4, 0, 0 }},
{"%g", "", { 0, 0, 0, 1, 0, -1901, 3, 364, 0 }},
{"%g", "", { 0, 0, 0, 1, 0, -1900, 0, 0, 0 }, FALSE, FALSE, "0/" }, {"%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 }},
@@ -988,8 +988,8 @@ static void test_strftime(void) {"%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},
{"%g", "", { 0, 0, 0, 1, 0, 8100, 4, 0, 0 }, TRUE},
{"%g", "", { 0, 0, 0, 1, 0, 8100, 0, 0, 0 }},
{"%g", "", { 0, 0, 0, 1, 0, 8100, 4, 0, 0 }}, {"%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 }},
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/msvcrt/time.c | 13 ++++++++- dlls/ucrtbase/tests/misc.c | 57 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 66 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 50e571540f..eea47ec2cd 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1196,7 +1196,7 @@ static MSVCRT_size_t strftime_impl(STRFTIME_CHAR *str, MSVCRT_size_t max, MSVCRT_size_t ret, tmp; BOOL alternate; #if _MSVCR_VER>=140 - int tmp_year; + int tmp_year, tmp_days; #endif int year = mstm ? mstm->tm_year + 1900 : -1;
@@ -1342,6 +1342,17 @@ static MSVCRT_size_t strftime_impl(STRFTIME_CHAR *str, MSVCRT_size_t max, return 0; } break; + case 'V': + tmp_year = year; + tmp_days = mstm->tm_yday - (mstm->tm_wday ? mstm->tm_wday : 7) + 4; + if (tmp_days < 0) + tmp_days += 365 + IsLeapYear(--tmp_year); + else if(tmp_days >= 365 + IsLeapYear(tmp_year)) + tmp_days -= 365 + IsLeapYear(tmp_year++); + + if(!strftime_int(str, &ret, max, tmp_days/7 + 1, alternate ? 0 : 2, 0, 53)) + return 0; + break; #endif case 'H': if(!strftime_int(str, &ret, max, mstm->tm_hour, alternate ? 0 : 2, 0, 23)) diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index a33742e9c1..de1c0f1288 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -994,9 +994,9 @@ static void test_strftime(void) {"%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 }}, + {"%V", "52", { 0, 0, 0, 1, 0, 117, 0, 0, 0 }}, + {"%V", "53", { 0, 0, 14, 1, 0, 121, 6, 0, 0 }}, {"%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 }}, @@ -1081,6 +1081,42 @@ static void test_strftime(void) { "%#x", "y1970", 0, L"yyyyy", 0, { 0, 0, 0, 1, 0, 70, 0, 0, 0 }}, };
+ const struct { + int year; + int yday; + const char *ret[7]; + } tests_yweek[] = { + { 100, 0, { "99 52", "00 01", "00 01", "00 01", "00 01", "99 53", "99 52" }}, + { 100, 1, { "99 52", "00 01", "00 01", "00 01", "00 01", "00 01", "99 53" }}, + { 100, 2, { "99 53", "00 01", "00 01", "00 01", "00 01", "00 01", "00 01" }}, + { 100, 3, { "00 01", "00 01", "00 01", "00 01", "00 01", "00 01", "00 01" }}, + { 100, 4, { "00 01", "00 02", "00 01", "00 01", "00 01", "00 01", "00 01" }}, + { 100, 5, { "00 01", "00 02", "00 02", "00 01", "00 01", "00 01", "00 01" }}, + { 100, 6, { "00 01", "00 02", "00 02", "00 02", "00 01", "00 01", "00 01" }}, + { 100, 358, { "00 51", "00 52", "00 52", "00 52", "00 52", "00 52", "00 51" }}, + { 100, 359, { "00 51", "00 52", "00 52", "00 52", "00 52", "00 52", "00 52" }}, + { 100, 360, { "00 52", "00 52", "00 52", "00 52", "00 52", "00 52", "00 52" }}, + { 100, 361, { "00 52", "00 53", "00 52", "00 52", "00 52", "00 52", "00 52" }}, + { 100, 362, { "00 52", "00 53", "00 53", "00 52", "00 52", "00 52", "00 52" }}, + { 100, 363, { "00 52", "01 01", "00 53", "00 53", "00 52", "00 52", "00 52" }}, + { 100, 364, { "00 52", "01 01", "01 01", "00 53", "00 53", "00 52", "00 52" }}, + { 100, 365, { "00 52", "01 01", "01 01", "01 01", "00 53", "00 53", "00 52" }}, + { 101, 0, { "00 52", "01 01", "01 01", "01 01", "01 01", "00 53", "00 53" }}, + { 101, 1, { "00 53", "01 01", "01 01", "01 01", "01 01", "01 01", "00 53" }}, + { 101, 2, { "00 53", "01 01", "01 01", "01 01", "01 01", "01 01", "01 01" }}, + { 101, 3, { "01 01", "01 01", "01 01", "01 01", "01 01", "01 01", "01 01" }}, + { 101, 4, { "01 01", "01 02", "01 01", "01 01", "01 01", "01 01", "01 01" }}, + { 101, 5, { "01 01", "01 02", "01 02", "01 01", "01 01", "01 01", "01 01" }}, + { 101, 6, { "01 01", "01 02", "01 02", "01 02", "01 01", "01 01", "01 01" }}, + { 101, 358, { "01 51", "01 52", "01 52", "01 52", "01 52", "01 52", "01 51" }}, + { 101, 359, { "01 51", "01 52", "01 52", "01 52", "01 52", "01 52", "01 52" }}, + { 101, 360, { "01 52", "01 52", "01 52", "01 52", "01 52", "01 52", "01 52" }}, + { 101, 361, { "01 52", "01 53", "01 52", "01 52", "01 52", "01 52", "01 52" }}, + { 101, 362, { "01 52", "02 01", "01 53", "01 52", "01 52", "01 52", "01 52" }}, + { 101, 363, { "01 52", "02 01", "02 01", "01 53", "01 52", "01 52", "01 52" }}, + { 101, 364, { "01 52", "02 01", "02 01", "02 01", "01 53", "01 52", "01 52" }}, + }; + __lc_time_data time_data = { { "d1", "d2", "d3", "d4", "d5", "d6", "d7" }, { "day1", "day2", "day3", "day4", "day5", "day6", "day7" }, @@ -1095,6 +1131,7 @@ static void test_strftime(void) };
const struct tm epoch = { 0, 0, 0, 1, 0, 70, 4, 0, 0 }; + struct tm tm_yweek = { 0, 0, 0, 1, 0, 70, 0, 0, 0 }; char buf[256]; int i, ret=0;
@@ -1137,6 +1174,20 @@ static void test_strftime(void) i, buf, tests_td[i].ret); } } + + for (i=0; i<ARRAY_SIZE(tests_yweek); i++) + { + int j; + tm_yweek.tm_year = tests_yweek[i].year; + tm_yweek.tm_yday = tests_yweek[i].yday; + for (j=0; j<7; j++) + { + tm_yweek.tm_wday = j; + p_strftime(buf, sizeof(buf), "%g %V", &tm_yweek); + ok(!strcmp(buf, tests_yweek[i].ret[j]), "%d,%d) buf = "%s", expected "%s"\n", + i, j, buf, tests_yweek[i].ret[j]); + } + } }
static LONG* get_failures_counter(HANDLE *map)
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/msvcrt/time.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index eea47ec2cd..0376d355f2 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1328,20 +1328,6 @@ static MSVCRT_size_t strftime_impl(STRFTIME_CHAR *str, MSVCRT_size_t max, case 'G': if(!MSVCRT_CHECK_PMT(year>=0 && year<=9999)) goto einval_error; - tmp_year = year; - if (mstm->tm_yday - (mstm->tm_wday ? mstm->tm_wday : 7) + 4 < 0) - tmp_year--; - else if(mstm->tm_yday - (mstm->tm_wday ? mstm->tm_wday : 7) + 5 > 365 + IsLeapYear(tmp_year)) - tmp_year++; - if(*format == 'G') - { - if (!strftime_int(str, &ret, max, tmp_year, 4, 0, 9999)) - return 0; - } else { - if (!strftime_int(str, &ret, max, tmp_year%100, 2, 0, 99)) - return 0; - } - break; case 'V': tmp_year = year; tmp_days = mstm->tm_yday - (mstm->tm_wday ? mstm->tm_wday : 7) + 4; @@ -1350,8 +1336,16 @@ static MSVCRT_size_t strftime_impl(STRFTIME_CHAR *str, MSVCRT_size_t max, else if(tmp_days >= 365 + IsLeapYear(tmp_year)) tmp_days -= 365 + IsLeapYear(tmp_year++);
- if(!strftime_int(str, &ret, max, tmp_days/7 + 1, alternate ? 0 : 2, 0, 53)) - return 0; + if(*format == 'G') { + if(!strftime_int(str, &ret, max, tmp_year, 4, 0, 9999)) + return 0; + } else if(*format == 'g') { + if(!strftime_int(str, &ret, max, tmp_year%100, 2, 0, 99)) + return 0; + } else { + if(!strftime_int(str, &ret, max, tmp_days/7 + 1, alternate ? 0 : 2, 0, 53)) + return 0; + } break; #endif case 'H':
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=60858
Your paranoid android.
=== debian10 (32 bit report) ===
ucrtbase: misc.c:1108: Test succeeded inside todo block: expected global_invalid_parameter_handler
=== debian10 (32 bit French report) ===
ucrtbase: misc.c:1108: Test succeeded inside todo block: expected global_invalid_parameter_handler
=== debian10 (32 bit Japanese:Japan report) ===
ucrtbase: misc.c:1108: Test succeeded inside todo block: expected global_invalid_parameter_handler
=== debian10 (32 bit Chinese:China report) ===
ucrtbase: misc.c:1108: Test succeeded inside todo block: expected global_invalid_parameter_handler
=== debian10 (32 bit WoW report) ===
ucrtbase: misc.c:1108: Test succeeded inside todo block: expected global_invalid_parameter_handler
=== debian10 (64 bit WoW report) ===
ucrtbase: misc.c:1108: Test succeeded inside todo block: expected global_invalid_parameter_handler
Hi Jeff,
On 11/26/19 7:00 AM, Jeff Smith wrote:
{"%g", "", { 0, 0, 0, 1, 0, -1900, 0, 0, 0 }, TRUE, FALSE, "0/" },
Is this test working on any Windows machine when "broken" result is removed? If not I would suggest to remove it or implement the same behavior in Wine.
(Also the tests are not working on Wine, see Marvin's message).
Thanks, Piotr