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
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
34{
35 /* Test border ctime cases */
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
44{
46 Test_ctime();
47}
48
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define ok(value,...)
Definition: atltest.h:57
#define START_TEST(x)
Definition: atltest.h:75
#define NULL
Definition: types.h:112
__kernel_time_t time_t
Definition: linux.h:252
__u16 ctime
Definition: mkdosfs.c:4
__u16 time
Definition: mkdosfs.c:8
void Test_ctime()
Definition: time.c:33
void Test_asctime()
Definition: time.c:13
_Check_return_ _CRTIMP char *__cdecl asctime(_In_ const struct tm *_Tm)
Definition: time.h:68