summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-12-05 22:20:06 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-12-05 23:09:13 +0100
commit654e0102ddb0acaaf45fb55c15818722235fcc9f (patch)
treee2b3e2044fa3f2d152cf04a32d3b9ff7f8042587
parent55dba7bd160e1514d06f6361879c5b789e64aca8 (diff)
downloadsamba-654e0102ddb0acaaf45fb55c15818722235fcc9f.tar.gz
samba-654e0102ddb0acaaf45fb55c15818722235fcc9f.tar.bz2
samba-654e0102ddb0acaaf45fb55c15818722235fcc9f.zip
lib/util:tests/time.c - "test_timestring" - fix it on Solaris
Solaris returns "Thu Jan 01" and not "Thu Jan 1" - therefore proof for both. Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Sun Dec 5 23:09:13 CET 2010 on sn-devel-104
-rw-r--r--lib/util/tests/time.c8
1 files changed, 5 insertions, 3 deletions
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;
}