From 5fac518cefdba5c06829be187cefa3e904a7e1b3 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 22 Mar 2015 23:05:28 +0000 Subject: tests: add test_dmesg that has fixed boot time This allows testing time stamp formats. Signed-off-by: Sami Kerola --- sys-utils/dmesg.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys-utils/dmesg.c') diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index b56199f36..a17cc70af 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -1378,8 +1378,13 @@ int main(int argc, char *argv[]) is_timefmt(&ctl, CTIME) || is_timefmt(&ctl, ISO8601)) { +#ifdef TEST_DMESG + ctl.boot_time.tv_sec = 1234567890; + ctl.boot_time.tv_usec = 123456; +#else if (get_boot_time(&ctl.boot_time) != 0) ctl.time_fmt = DMESG_TIMEFTM_NONE; +#endif } if (delta) -- cgit v1.2.3-55-g7522