summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}