From 197180031bad1e51ee032d30d8a095a51207454c Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 11 Mar 2020 10:31:36 -0400 Subject: vppinfra: refactor clib_timebase_t Add a clib_time_t * argument to clib_timebase_init(...), to encourage client code to share the vlib_main_t's clib_time_t object. Display the current day / date in GMT via the "show time" debug CLI. Fix the test framework so it processes the new "show time" output format. Type: refactor Signed-off-by: Dave Barach Change-Id: I5e52d57eb164b7cdb6355362d520df6928491711 --- src/plugins/unittest/mactime_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins/unittest') diff --git a/src/plugins/unittest/mactime_test.c b/src/plugins/unittest/mactime_test.c index 907022f4d88..46d6263b938 100644 --- a/src/plugins/unittest/mactime_test.c +++ b/src/plugins/unittest/mactime_test.c @@ -18,6 +18,7 @@ static int test_time_range_main (unformat_input_t * input) { + vlib_main_t *vm = vlib_get_main (); clib_timebase_t _tb, *tb = &_tb; clib_timebase_component_t _c, *cp = &_c; clib_timebase_range_t *rp = 0; @@ -30,7 +31,8 @@ test_time_range_main (unformat_input_t * input) f64 timezone_offset; /* Init time base */ - clib_timebase_init (tb, -5 /* EST */ , CLIB_TIMEBASE_DAYLIGHT_USA); + clib_timebase_init (tb, -5 /* EST */ , CLIB_TIMEBASE_DAYLIGHT_USA, + &vm->clib_time); /* Set up summer time cache */ now = clib_timebase_now (tb); -- cgit 1.2.3-korg