]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
test/test_ipaddr: always set ifa_flags
authorKefu Chai <kchai@redhat.com>
Mon, 19 Jul 2021 03:22:18 +0000 (11:22 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 19 Jul 2021 03:29:35 +0000 (11:29 +0800)
commit1701023d16b78f176ed8adb353446c78bdc5889f
tree57b2466f1e47a35990cc4167f1178e70016e72c2
parent43d0e2c21852e732c1d19c93a104de3b5b8314d7
test/test_ipaddr: always set ifa_flags

do not rely on the uninitialized bits on stack for testing, otherwise
there is chance that we have following test failure:

64: ../src/test/test_ipaddr.cc:226: Failure
64: Expected equality of these values:
64:   two.ifa_addr
64:     Which is: 127.0.0.1:57677
64:   result
64:     Which is: 127.0.0.1:57677

the root cause is just that the "result" is actually `one.ifa_addr`,
which is marked UP as that's what the uninitialized bits on stack
indicate.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/test_ipaddr.cc