1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-13 12:58:20 +03:00

test-networkd-address: fix clock type

The clock to use internally is clock_boottime_or_monotonic(), but the
test used CLOCK_MONOTONIC. After one system suspend the test thus likely
starts to fail.
This commit is contained in:
Lennart Poettering 2021-10-22 09:39:55 +02:00
parent c496451216
commit e0e914eaf8

View File

@ -16,7 +16,7 @@ static void test_FORMAT_LIFETIME(void) {
log_info("/* %s */", __func__);
now_usec = now(CLOCK_MONOTONIC);
now_usec = now(clock_boottime_or_monotonic());
test_FORMAT_LIFETIME_one(now_usec, "for 0");
test_FORMAT_LIFETIME_one(usec_add(now_usec, 2 * USEC_PER_SEC - 1), "for 1s");
@ -25,7 +25,7 @@ static void test_FORMAT_LIFETIME(void) {
}
int main(int argc, char *argv[]) {
test_setup_logging(LOG_INFO);
test_setup_logging(LOG_DEBUG);
test_FORMAT_LIFETIME();