diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-12-05 22:20:06 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-12-05 23:09:13 +0100 |
commit | 654e0102ddb0acaaf45fb55c15818722235fcc9f (patch) | |
tree | e2b3e2044fa3f2d152cf04a32d3b9ff7f8042587 | |
parent | 55dba7bd160e1514d06f6361879c5b789e64aca8 (diff) | |
download | samba-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.c | 8 |
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; } |