Files
RedBear-OS/tests/time/asctime.c
T
Tibor Nagy d1a424c002 tests: Replace returns with exits in the main functions
This will allow us to redefine the exit function.

For example:
```
#define exit(code) { \
    fprintf(stderr, "%s:%d: exit(%s) in function ‘%s’\n",
        __FILE__, __LINE__, #code, __func__); \
    _exit(code); \
}
```
2019-02-21 12:15:06 +01:00

16 lines
323 B
C

#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
time_t a = 0;
struct tm *time_info = gmtime(&a);
char *time_string = asctime(time_info);
if (time_string == NULL || strcmp(time_string, "Thu Jan 1 00:00:00 1970\n") != 0) {
exit(EXIT_FAILURE);
}
}