From 654e0102ddb0acaaf45fb55c15818722235fcc9f Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 5 Dec 2010 22:20:06 +0100 Subject: lib/util:tests/time.c - "test_timestring" - fix it on Solaris MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Solaris returns "Thu Jan 01" and not "Thu Jan 1" - therefore proof for both. Autobuild-User: Matthias Dieter Wallnöfer Autobuild-Date: Sun Dec 5 23:09:13 CET 2010 on sn-devel-104 --- lib/util/tests/time.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/util/tests/time.c b/lib/util/tests/time.c index d08a4e79d1..8b0a0c357d 100644 --- a/lib/util/tests/time.c +++ b/lib/util/tests/time.c @@ -64,7 +64,7 @@ static bool test_http_timestring(struct torture_context *tctx) static bool test_timestring(struct torture_context *tctx) { - const char *start = "Thu Jan 1"; + const char *start = "Thu Jan 1", *start2 = "Thu Jan 01"; char *result; /* * Correct test for negative UTC offset. Without the correction, the @@ -77,8 +77,10 @@ static bool test_timestring(struct torture_context *tctx) time_t utc_offset = mktime(&local) - mktime(&gmt); result = timestring(tctx, 42 - (utc_offset < 0 ? utc_offset : 0)); - torture_assert(tctx, !strncmp(start, result, strlen(start)), - result); + torture_assert(tctx, + (strncmp(start, result, strlen(start)) == 0) || + (strncmp(start2, result, strlen(start2)) == 0), + result); return true; } -- cgit