summaryrefslogtreecommitdiff
path: root/lib/util/tests
diff options
context:
space:
mode:
Diffstat (limited to 'lib/util/tests')
-rw-r--r--lib/util/tests/time.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/util/tests/time.c b/lib/util/tests/time.c
index 8b0a0c357d..78e8121b63 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", *start2 = "Thu Jan 01";
+ const char *start = "Thu Jan 1";
char *result;
/*
* Correct test for negative UTC offset. Without the correction, the
@@ -77,10 +77,7 @@ 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)) == 0) ||
- (strncmp(start2, result, strlen(start2)) == 0),
- result);
+ torture_assert(tctx, !strncmp(start, result, strlen(start)), result);
return true;
}