Commit 8b10fb87 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

ucrtbase: Add a test that shows asctime() uses space-padding for day of month.

parent 1333206e
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <share.h> #include <share.h>
#include <fcntl.h> #include <fcntl.h>
#include <time.h>
#include <windef.h> #include <windef.h>
#include <winbase.h> #include <winbase.h>
...@@ -123,6 +124,7 @@ static int (CDECL *p__iswblank_l)(wint_t,_locale_t); ...@@ -123,6 +124,7 @@ static int (CDECL *p__iswblank_l)(wint_t,_locale_t);
static int (CDECL *p_fesetround)(int); static int (CDECL *p_fesetround)(int);
static void (CDECL *p___setusermatherr)(MSVCRT_matherr_func); static void (CDECL *p___setusermatherr)(MSVCRT_matherr_func);
static int* (CDECL *p_errno)(void); static int* (CDECL *p_errno)(void);
static char* (CDECL *p_asctime)(const struct tm *);
static void test__initialize_onexit_table(void) static void test__initialize_onexit_table(void)
{ {
...@@ -426,6 +428,7 @@ static BOOL init(void) ...@@ -426,6 +428,7 @@ static BOOL init(void)
p_fesetround = (void*)GetProcAddress(module, "fesetround"); p_fesetround = (void*)GetProcAddress(module, "fesetround");
p___setusermatherr = (void*)GetProcAddress(module, "__setusermatherr"); p___setusermatherr = (void*)GetProcAddress(module, "__setusermatherr");
p_errno = (void*)GetProcAddress(module, "_errno"); p_errno = (void*)GetProcAddress(module, "_errno");
p_asctime = (void*)GetProcAddress(module, "asctime");
return TRUE; return TRUE;
} }
...@@ -747,6 +750,21 @@ static void test_math_errors(void) ...@@ -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) START_TEST(misc)
{ {
int arg_c; int arg_c;
...@@ -772,4 +790,5 @@ START_TEST(misc) ...@@ -772,4 +790,5 @@ START_TEST(misc)
test_lldiv(); test_lldiv();
test_isblank(); test_isblank();
test_math_errors(); test_math_errors();
test_asctime();
} }
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