summaryrefslogtreecommitdiff
path: root/src/test/test-date.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-09-17 09:50:52 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-09-17 11:57:00 +0200
commita3da4a3d0af6b77c2d6ef809f6defd1de0d88d53 (patch)
treec27302c14b8f3942a06e6c71698cc4f5d47fda94 /src/test/test-date.c
parenta2932a0d1a5a061e51f91b4834ca631e367fe997 (diff)
downloadsystemd-a3da4a3d0af6b77c2d6ef809f6defd1de0d88d53.tar.gz
test-date: add more logging on error
Diffstat (limited to 'src/test/test-date.c')
-rw-r--r--src/test/test-date.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/test-date.c b/src/test/test-date.c
index 5cbb8bcc3c..c09d615396 100644
--- a/src/test/test-date.c
+++ b/src/test/test-date.c
@@ -33,6 +33,12 @@ static void test_should_pass(const char *p) {
log_info("\"%s\" → \"%s\"", p, buf);
assert_se(parse_timestamp(buf, &q) >= 0);
+ if (q != t) {
+ char tmp[FORMAT_TIMESTAMP_MAX];
+
+ log_error("round-trip failed: \"%s\" → \"%s\"",
+ buf, format_timestamp_us(tmp, sizeof(tmp), q));
+ }
assert_se(q == t);
assert_se(format_timestamp_relative(buf_relative, sizeof(buf_relative), t));
@@ -77,6 +83,10 @@ static void test_one_noutc(const char *p) {
}
int main(int argc, char *argv[]) {
+ log_set_max_level(LOG_DEBUG);
+ log_parse_environment();
+ log_open();
+
test_one("17:41");
test_one("18:42:44");
test_one("18:42:44.0");