libafs: allow bkg daemon requests without creds
[openafs.git] / tests / util / ktime-t.c
index f09f4e1..9609fbb 100644 (file)
 #include <afs/param.h>
 
 #include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <time.h>
 
 #include <afs/ktime.h>
-#include <tap/basic.h>
+#include <afs/afsutil.h>
+#include <afs/afsutil_prototypes.h>
+#include <tests/tap/basic.h>
 
 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,8 +64,8 @@ static struct testTime {
 int
 main(void)
 {
-    long code, temp;
-    int errors;
+    long code;
+    afs_int32 temp;
     time_t t;
     struct testTime *tt;
 
@@ -69,10 +75,10 @@ main(void)
      * work in other than EST */
     putenv("TZ=EST");
 
-    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);