ReactOS 0.4.15-dev-7994-gb388cb6
time.c File Reference
#include <stdio.h>
#include <time.h>
#include <wine/test.h>
Include dependency graph for time.c:

Go to the source code of this file.

Functions

void Test_asctime ()
 
void Test_ctime ()
 
 START_TEST (time)
 

Function Documentation

◆ START_TEST()

START_TEST ( time  )

Definition at line 43 of file time.c.

44{
46 Test_ctime();
47}
void Test_ctime()
Definition: time.c:33
void Test_asctime()
Definition: time.c:13

◆ Test_asctime()

void Test_asctime ( )

Definition at line 13 of file time.c.

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}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define ok(value,...)
Definition: atltest.h:57
__u16 time
Definition: mkdosfs.c:8
_Check_return_ _CRTIMP char *__cdecl asctime(_In_ const struct tm *_Tm)
Definition: time.h:68

Referenced by START_TEST().

◆ Test_ctime()

void Test_ctime ( )

Definition at line 33 of file time.c.

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}
#define NULL
Definition: types.h:112
__kernel_time_t time_t
Definition: linux.h:252
__u16 ctime
Definition: mkdosfs.c:4

Referenced by START_TEST().