Akihiro Sagawa : ucrtbase: Add a test that shows asctime() uses space-padding for day of month.
Alexandre Julliard
julliard at winehq.org
Tue Mar 13 17:10:52 CDT 2018
Module: wine
Branch: master
Commit: 8b10fb8758c5b9b07b0f0cabbd57c10d11b1d2ec
URL: https://source.winehq.org/git/wine.git/?a=commit;h=8b10fb8758c5b9b07b0f0cabbd57c10d11b1d2ec
Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date: Sun Mar 11 22:14:22 2018 +0900
ucrtbase: Add a test that shows asctime() uses space-padding for day of month.
Signed-off-by: Akihiro Sagawa <sagawa.aki at gmail.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 d17f2d0..4a95910 100644
--- a/dlls/ucrtbase/tests/misc.c
+++ b/dlls/ucrtbase/tests/misc.c
@@ -26,6 +26,7 @@
#include <sys/stat.h>
#include <share.h>
#include <fcntl.h>
+#include <time.h>
#include <windef.h>
#include <winbase.h>
@@ -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();
}
More information about the wine-cvs
mailing list