summaryrefslogtreecommitdiffstats
path: root/src/test/test-time-util.c
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2023-12-26 20:23:19 +0100
committerFrantisek Sumsal <frantisek@sumsal.cz>2023-12-27 11:15:48 +0100
commitb8e0dd39393ca041cea50c7f1d54faaaf6d4e834 (patch)
tree9de0d445eb9f2734b31120ae070af13046f17c12 /src/test/test-time-util.c
parenttest: use set_isempty() in one more place (diff)
downloadsystemd-b8e0dd39393ca041cea50c7f1d54faaaf6d4e834.tar.xz
systemd-b8e0dd39393ca041cea50c7f1d54faaaf6d4e834.zip
test: use timestamp_is_set()
Diffstat (limited to '')
-rw-r--r--src/test/test-time-util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c
index 76931ce0ab..d29afa38dd 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);
}
}