test suite warning safety
authorDerrick Brashear <shadow@dementia.org>
Mon, 21 Jun 2010 05:06:38 +0000 (01:06 -0400)
committerDerrick Brashear <shadow@dementia.org>
Tue, 22 Jun 2010 15:47:58 +0000 (08:47 -0700)
make test suite compile without warning

Change-Id: I4e4b63d6ce2ae73e5458913aa81308b2691044a9
Reviewed-on: http://gerrit.openafs.org/2223
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

tests/runtests.c
tests/util/ktime-t.c

index da01595..af057a3 100644 (file)
@@ -449,7 +449,7 @@ test_checkline(const char *line, struct testset *ts)
             if (bail[length - 1] == '\n')
                 length--;
             test_backspace(ts);
-            printf("ABORTED (%.*s)\n", length, bail);
+            printf("ABORTED (%.*s)\n", (int)length, bail);
             ts->reported = 1;
         }
         ts->aborted = 1;
index f09f4e1..7b6297b 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 <afs/afsutil.h>
+#include <afs/afsutil_prototypes.h>
 #include <tap/basic.h>
 
 static struct testTime {
@@ -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;
@@ -72,7 +79,8 @@ main(void)
     errors = 0;
     for (tt = testTimes; tt->time; tt++) {
         t = 0;
-       code = ktime_DateToLong(tt->time, &t);
+       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);