Add it build Czech catalog KeyShow (tools)
[AROS.git] / test / dos / strtodate.c
blobb8daeb852a6f9d91a7bf5e622c419a0ce43153f3
1 /*
2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <dos/datetime.h>
7 #include <dos/dos.h>
8 #include <proto/dos.h>
9 #include <string.h>
10 #include <stdio.h>
12 struct DateTime dt;
13 struct DateStamp ds;
14 char s[100];
16 LONG days = 0;
18 int main(void)
20 LONG result = RETURN_OK;
24 dt.dat_Stamp.ds_Days = days;
25 dt.dat_Format = FORMAT_DOS;
26 dt.dat_StrDate = s;
28 DateToStr(&dt);
30 dt.dat_Stamp.ds_Days = -1;
31 StrToDate(&dt);
33 //printf("date \"%s\" day = %ld\n", s, days);
35 if (dt.dat_Stamp.ds_Days != days)
37 printf("Bad results for date \"%s\" (day #%ld). "
38 "StrToDate thought it was day #%ld\n", s, (long)days,
39 (long)dt.dat_Stamp.ds_Days);
40 result = RETURN_ERROR;
43 days++;
46 while (!CheckSignal(SIGBREAKF_CTRL_C) && (days < 36525));
47 /* 2078-01-01: same as 1978 in FORMAT_DOS */
49 return result;