From 8b10fb8758c5b9b07b0f0cabbd57c10d11b1d2ec Mon Sep 17 00:00:00 2001 From: Akihiro Sagawa Date: Sun, 11 Mar 2018 22:14:22 +0900 Subject: [PATCH] ucrtbase: Add a test that shows asctime() uses space-padding for day of month. Signed-off-by: Akihiro Sagawa Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/ucrtbase/tests/misc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index d17f2d08864..4a9591002c3 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -123,6 +124,7 @@ static int (CDECL *p__iswblank_l)(wint_t,_locale_t); static int (CDECL *p_fesetround)(int); static void (CDECL *p___setusermatherr)(MSVCRT_matherr_func); static int* (CDECL *p_errno)(void); +static char* (CDECL *p_asctime)(const struct tm *); static void test__initialize_onexit_table(void) { @@ -426,6 +428,7 @@ static BOOL init(void) p_fesetround = (void*)GetProcAddress(module, "fesetround"); p___setusermatherr = (void*)GetProcAddress(module, "__setusermatherr"); p_errno = (void*)GetProcAddress(module, "_errno"); + p_asctime = (void*)GetProcAddress(module, "asctime"); return TRUE; } @@ -747,6 +750,21 @@ static void test_math_errors(void) } } +static void test_asctime(void) +{ + const struct tm epoch = { 0, 0, 0, 1, 0, 70, 4, 0, 0 }; + char *ret; + + if(!p_asctime) + { + win_skip("asctime is not available\n"); + return; + } + + ret = p_asctime(&epoch); + todo_wine ok(!strcmp(ret, "Thu Jan 1 00:00:00 1970\n"), "asctime returned %s\n", ret); +} + START_TEST(misc) { int arg_c; @@ -772,4 +790,5 @@ START_TEST(misc) test_lldiv(); test_isblank(); test_math_errors(); + test_asctime(); }