From 19869b100cc144422f2e5e845773d92082a32e40 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 21 Jun 2010 01:06:38 -0400 Subject: [PATCH] test suite warning safety make test suite compile without warning Change-Id: I4e4b63d6ce2ae73e5458913aa81308b2691044a9 Reviewed-on: http://gerrit.openafs.org/2223 Reviewed-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- tests/runtests.c | 2 +- tests/util/ktime-t.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/runtests.c b/tests/runtests.c index da01595..af057a3 100644 --- a/tests/runtests.c +++ b/tests/runtests.c @@ -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; diff --git a/tests/util/ktime-t.c b/tests/util/ktime-t.c index f09f4e1..7b6297b 100644 --- a/tests/util/ktime-t.c +++ b/tests/util/ktime-t.c @@ -11,8 +11,14 @@ #include #include +#ifdef HAVE_STDLIB_H +#include +#endif +#include #include +#include +#include #include 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); -- 1.9.4