chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sd-rtnl: route - allow GETROUTE with AF_UNSPEC
[elogind.git]
/
src
/
test
/
test-date.c
diff --git
a/src/test/test-date.c
b/src/test/test-date.c
index 40ffc17b2f7f48cc10c3e97d4d9798b0815e27b3..00b569080ccaa04809882b70af82e7e93197c6de 100644
(file)
--- a/
src/test/test-date.c
+++ b/
src/test/test-date.c
@@
-28,7
+28,8
@@
static void test_one(const char *p) {
char buf[FORMAT_TIMESTAMP_MAX], buf_relative[FORMAT_TIMESTAMP_RELATIVE_MAX];
assert_se(parse_timestamp(p, &t) >= 0);
char buf[FORMAT_TIMESTAMP_MAX], buf_relative[FORMAT_TIMESTAMP_RELATIVE_MAX];
assert_se(parse_timestamp(p, &t) >= 0);
- log_info("%s", format_timestamp(buf, sizeof(buf), t));
+ format_timestamp(buf, sizeof(buf), t);
+ log_info("%s", buf);
/* Chop off timezone */
*strrchr(buf, ' ') = 0;
/* Chop off timezone */
*strrchr(buf, ' ') = 0;
@@
-36,7
+37,8
@@
static void test_one(const char *p) {
assert_se(parse_timestamp(buf, &q) >= 0);
assert_se(q == t);
assert_se(parse_timestamp(buf, &q) >= 0);
assert_se(q == t);
- log_info("%s", strna(format_timestamp_relative(buf_relative, sizeof(buf_relative), t)));
+ format_timestamp_relative(buf_relative, sizeof(buf_relative), t);
+ log_info("%s", strna(buf_relative));
assert_se(parse_timestamp(buf, &q) >= 0);
}
assert_se(parse_timestamp(buf, &q) >= 0);
}
@@
-56,6
+58,7
@@
int main(int argc, char *argv[]) {
test_one("+2d");
test_one("+2y 4d");
test_one("5months ago");
test_one("+2d");
test_one("+2y 4d");
test_one("5months ago");
+ test_one("@1395716396");
return 0;
}
return 0;
}