summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-01-08 12:45:57 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-01-08 12:45:57 +0100
commit078879735be86c9e9f9be77a6d1cda3d0f9374a3 (patch)
tree8780033f37d0b0ae3d4748910f8083a078a7c928 /lib
parent3318204d294f3b3ac3409f192edc3eddeada245b (diff)
downloadsamba-078879735be86c9e9f9be77a6d1cda3d0f9374a3.tar.gz
samba-078879735be86c9e9f9be77a6d1cda3d0f9374a3.tar.bz2
samba-078879735be86c9e9f9be77a6d1cda3d0f9374a3.zip
Print the failed value in the time tests.
Diffstat (limited to 'lib')
-rw-r--r--lib/util/tests/time.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/util/tests/time.c b/lib/util/tests/time.c
index e24c5fe5ef..b7cb608611 100644
--- a/lib/util/tests/time.c
+++ b/lib/util/tests/time.c
@@ -43,18 +43,21 @@ static bool test_null_nttime(struct torture_context *tctx)
static bool test_http_timestring(struct torture_context *tctx)
{
const char *start = "Thu, 01 Jan 1970";
- torture_assert(tctx, !strncmp(start, http_timestring(tctx, 42),
- strlen(start)), "42");
+ char *result;
+ result = http_timestring(tctx, 42);
+ torture_assert(tctx, !strncmp(start, result,
+ strlen(start)), result);
torture_assert_str_equal(tctx, "never",
- http_timestring(tctx, get_time_t_max()), "42");
+ http_timestring(tctx, get_time_t_max()), "42");
return true;
}
static bool test_timestring(struct torture_context *tctx)
{
const char *start = "Thu Jan 1";
- torture_assert(tctx, !strncmp(start, timestring(tctx, 42), strlen(start)),
- "42");
+ char *result = timestring(tctx, 42);
+ torture_assert(tctx, !strncmp(start, result, strlen(start)),
+ result);
return true;
}