X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=tests%2Futil%2Fktime-t.c;h=fefbcb370f43880c0ca8ef3e209f2762e430345e;hp=f09f4e11b7bb1fe7dad83d0da6d010b2fe8382cf;hb=465321e3f43645efedb44168968f871fe5be4daa;hpb=2e2494d6dbc3b4584c50b87073a2b7c7a0d13604 diff --git a/tests/util/ktime-t.c b/tests/util/ktime-t.c index f09f4e1..fefbcb3 100644 --- a/tests/util/ktime-t.c +++ b/tests/util/ktime-t.c @@ -11,17 +11,23 @@ #include #include +#ifdef HAVE_STDLIB_H +#include +#endif +#include #include +#include +#include #include static struct testTime { char *time; long code; - long sec; + time_t sec; } testTimes[] = { { "now", 1, 0 }, /* lookup current time */ - { "never", 0, 0xffffffff }, + { "never", 0, (afs_int32) -1 }, { "12/3/89", 0, 628664400 }, { "1/1/1", 0, 978325200 }, { "1/0/80", -2, 0 }, @@ -58,7 +64,8 @@ static struct testTime { int main(void) { - long code, temp; + long code; + afs_int32 temp; int errors; time_t t; struct testTime *tt; @@ -71,8 +78,9 @@ main(void) errors = 0; for (tt = testTimes; tt->time; tt++) { - t = 0; - code = ktime_DateToLong(tt->time, &t); + temp = 0; + code = ktime_DateToLong(tt->time, &temp); + t = temp; if (tt->code == 1) { is_int(0, code, "ktime_DateToLong return for %s", tt->time); ok((time(0) - t <= 1), "ktime_DateToLong result for %s", tt->time);