Fixup gmtime/localtime/mktime tests with all cases

This commit is contained in:
Colin Leroy-Mira
2024-01-10 22:43:49 +01:00
parent 10282a9b74
commit 01ee903cdf
2 changed files with 90 additions and 67 deletions

View File

@@ -75,6 +75,11 @@ int main (void)
{
int i;
if (mktime(NULL) != (time_t)-1) {
printf("mktime should return -1 with a NULL parameter\n");
fails++;
}
/* Verify conversion both ways */
for (i = 0; ; i++) {
time_t t = data[i].t;
@@ -91,6 +96,7 @@ int main (void)
}
if (strcmp(data[i].str, ctime(&t))) {
printf("0x%lx: unexpected ctime result: expected %s, got %s", t, data[i].str, ctime(&t));
fails++;
}
if (t == 0xFFFFFFFF)