Signed-off-by: Vijay Kiran Kamuju infyquest@gmail.com --- dlls/msvcrt/tests/time.c | 5 +++++ dlls/msvcrt/time.c | 3 +++ dlls/ucrtbase/tests/misc.c | 7 +++++++ 3 files changed, 15 insertions(+)
diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index 9795c92baf8..7eea78367db 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -628,6 +628,11 @@ static void test_strftime(void) ok(retA == 0, "expected 0, got %ld\n", retA); ok(errno==EINVAL || broken(errno==0xdeadbeef), "errno = %d\n", errno);
+ errno = 0xdeadbeef; + retA = p_strftime(bufA, 256, "%h", gmt_tm); + ok(retA == 0, "expected 0, got %ld\n", retA); + ok(errno==EINVAL || broken(errno==0xdeadbeef), "errno = %d\n", errno); + errno = 0xdeadbeef; retA = p_strftime(bufA, 256, "%R", gmt_tm); ok(retA == 0, "expected 0, got %ld\n", retA); diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index cbffd77f32e..6108ad17cce 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -1142,6 +1142,9 @@ static MSVCRT_size_t strftime_helper(char *str, MSVCRT_size_t max, const char *f return 0; break; case 'b': +#if _MSVCR_VER>=140 + case 'h': +#endif if(mstm->tm_mon<0 || mstm->tm_mon>11) goto einval_error; if(!strftime_str(str, &ret, max, time_data->str.names.short_mon[mstm->tm_mon])) diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index aecbc9dca52..cbdfa97c128 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -27,6 +27,7 @@ #include <sys/stat.h> #include <share.h> #include <fcntl.h> +#include <locale.h> #include <time.h> #include <direct.h>
@@ -938,6 +939,12 @@ static void test_strftime(void) retA = p_strftime(bufA, sizeof(bufA), "%#T", &epoch); ok(retA == 5, "expected 5, got %d\n", (int)retA); ok(!strcmp(bufA, "0:0:0"), "got %s\n", bufA); + + setlocale(LC_TIME, "C"); + + retA = p_strftime(bufA, sizeof(bufA), "%h", &epoch); + ok(retA == 3, "expected 3, got %ld\n", retA); + ok(!strcmp(bufA, "Jan"), "got %s\n", bufA); }
static LONG* get_failures_counter(HANDLE *map)
On 10/4/19 11:15 AM, Vijay Kiran Kamuju wrote:
- setlocale(LC_TIME, "C");
The setlocale call is not needed. You're also setting it in msvcrt instead of ucrtbase this way.
Thanks, Piotr
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=57415
Your paranoid android.
=== wvistau64_zh_CN (32 bit report) ===
msvcrt: time.c:925: Test failed: clock() = 15, expected 124
=== w1064v1809 (32 bit report) ===
msvcrt: time.c:925: Test failed: clock() = 218, expected 1060