ReactOS
0.4.16-dev-197-g92996da
time.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS CRT regression tests
3
* LICENSE: GPL - See COPYING in the top level directory
4
* FILE: rostests/regtests/crt/time.c
5
* PURPOSE: Tests for time functions of the CRT
6
* PROGRAMMERS: Gregor Schneider
7
*/
8
9
#include <stdio.h>
10
#include <time.h>
11
#include <
wine/test.h
>
12
13
void
Test_asctime
()
14
{
15
/* Test asctime */
16
struct
tm
time
;
17
char
* timestr;
18
char
explowtime[] =
"Mon Jun 04 00:30:20 1909\n"
;
/* XP's crt returns new line after the string */
19
20
time
.tm_hour = 0;
21
time
.tm_mday = 4;
22
time
.tm_min = 30;
23
time
.tm_mon = 5;
24
time
.tm_sec = 20;
25
time
.tm_wday = 1;
26
time
.tm_yday = 200;
27
time
.tm_year = 9;
28
29
timestr =
asctime
(&
time
);
30
ok
(!
strcmp
(timestr, explowtime),
"Wrong time returned, got %s\n"
, timestr);
31
}
32
33
void
Test_ctime
()
34
{
35
/* Test border ctime cases */
36
time_t
time
;
37
time
= -15;
38
ok
(
ctime
(&
time
) ==
NULL
,
"ctime doesn't return NULL for invalid parameters\n"
);
39
time
= -5000000;
40
ok
(
ctime
(&
time
) ==
NULL
,
"ctime doesn't return NULL for invalid parameters\n"
);
41
}
42
43
START_TEST
(
time
)
44
{
45
Test_asctime
();
46
Test_ctime
();
47
}
48
strcmp
int strcmp(const char *String1, const char *String2)
Definition:
utclib.c:469
ok
#define ok(value,...)
Definition:
atltest.h:57
START_TEST
#define START_TEST(x)
Definition:
atltest.h:75
NULL
#define NULL
Definition:
types.h:112
time_t
__kernel_time_t time_t
Definition:
linux.h:252
ctime
__u16 ctime
Definition:
mkdosfs.c:4
time
__u16 time
Definition:
mkdosfs.c:8
Test_ctime
void Test_ctime()
Definition:
time.c:33
Test_asctime
void Test_asctime()
Definition:
time.c:13
asctime
_Check_return_ _CRTIMP char *__cdecl asctime(_In_ const struct tm *_Tm)
test.h
tm
Definition:
time.h:68
modules
rostests
regtests
crt
time.c
Generated on Wed Oct 30 2024 06:13:08 for ReactOS by
1.9.6