From b8e0dd39393ca041cea50c7f1d54faaaf6d4e834 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Tue, 26 Dec 2023 20:23:19 +0100 Subject: [PATCH] test: use timestamp_is_set() --- src/test/test-time-util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c index 76931ce0ab3..d29afa38dd2 100644 --- a/src/test/test-time-util.c +++ b/src/test/test-time-util.c @@ -1089,9 +1089,9 @@ TEST(map_clock_usec) { assert_se(nowr < USEC_INFINITY - USEC_PER_DAY*7); /* overflow check */ x = nowr + USEC_PER_DAY*7; /* 1 week from now */ y = map_clock_usec(x, CLOCK_REALTIME, CLOCK_MONOTONIC); - assert_se(y > 0 && y < USEC_INFINITY); + assert_se(timestamp_is_set(y)); z = map_clock_usec(y, CLOCK_MONOTONIC, CLOCK_REALTIME); - assert_se(z > 0 && z < USEC_INFINITY); + assert_se(timestamp_is_set(z)); assert_se((z > x ? z - x : x - z) < USEC_PER_HOUR); assert_se(nowr > USEC_PER_DAY * 7); /* underflow check */ @@ -1100,7 +1100,7 @@ TEST(map_clock_usec) { if (y != 0) { /* might underflow if machine is not up long enough for the monotonic clock to be beyond 1w */ assert_se(y < USEC_INFINITY); z = map_clock_usec(y, CLOCK_MONOTONIC, CLOCK_REALTIME); - assert_se(z > 0 && z < USEC_INFINITY); + assert_se(timestamp_is_set(z)); assert_se((z > x ? z - x : x - z) < USEC_PER_HOUR); } }