From 348e3addc8cecd7da9aed8a98c75d3acac1ea1a2 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 2 Jul 2020 23:14:01 +0200 Subject: [PATCH] ndisc/tests: relax the assertion in "test-ndisc-fake.c" test:ERROR:../src/ndisc/tests/test-ndisc-fake.c:373:test_preference_changed_cb: assertion failed (_a->timestamp == (data->timestamp1 + 3)): (9 == 10) (cherry picked from commit 8209095ee1c462c69d5203cdef11c61bfb0aa546) (cherry picked from commit 75177f69675557c3ff2508eb75285396849d625e) (cherry picked from commit c32f993486395bb1a0050c09d290c290da44bb1b) (cherry picked from commit 712194ac8ca3bfbc4da0fbdb2ca4118f10b6f759) --- src/ndisc/tests/test-ndisc-fake.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ndisc/tests/test-ndisc-fake.c b/src/ndisc/tests/test-ndisc-fake.c index 9cd6f64637..da3c5e5698 100644 --- a/src/ndisc/tests/test-ndisc-fake.c +++ b/src/ndisc/tests/test-ndisc-fake.c @@ -66,6 +66,7 @@ match_gateway (const NMNDiscData *rdata, guint idx, const char *addr, guint32 ts const NMNDiscData *_rdata = (rdata); \ guint _idx = (idx); \ const NMNDiscAddress *_a; \ + guint _ts = (ts); \ \ g_assert (_rdata); \ g_assert_cmpint (_idx, <, _rdata->addresses_n); \ @@ -74,7 +75,8 @@ match_gateway (const NMNDiscData *rdata, guint idx, const char *addr, guint32 ts _a = &_rdata->addresses[_idx]; \ \ nmtst_assert_ip6_address (&_a->address, (addr)); \ - g_assert_cmpint (_a->timestamp, ==, (ts)); \ + g_assert_cmpint (_a->timestamp, >=, _ts); \ + g_assert_cmpint (_a->timestamp, <=, _ts + 1); \ g_assert_cmpint (_a->lifetime, ==, (lt)); \ g_assert_cmpint (_a->preferred, ==, (pref)); \ } G_STMT_END @@ -384,7 +386,7 @@ test_preference_changed_cb (NMNDisc *ndisc, const NMNDiscData *rdata, guint chan match_gateway (rdata, 0, "fe80::1", data->timestamp1 + 2, 10, NM_ICMPV6_ROUTER_PREF_HIGH); match_gateway (rdata, 1, "fe80::2", data->timestamp1 + 1, 10, NM_ICMPV6_ROUTER_PREF_MEDIUM); g_assert_cmpint (rdata->addresses_n, ==, 2); - match_address (rdata, 0, "2001:db8:a:a::1", data->timestamp1 + 3, 9, 9); + match_address (rdata, 0, "2001:db8:a:a::1", data->timestamp1 + 2, 9, 9); match_address (rdata, 1, "2001:db8:a:b::1", data->timestamp1 + 1, 10, 10); g_assert_cmpint (rdata->routes_n, ==, 2); match_route (rdata, 0, "2001:db8:a:a::", 64, "fe80::1", data->timestamp1 + 2, 10, 15);