blob: e88c64bbf74c25318019eb53a093c49fd8ea3fc5 [file] [log] [blame]
William A. Kennington IIIfd862be2022-10-09 18:40:55 -07001#include "system_queries.hpp"
2
William A. Kennington IIIfd862be2022-10-09 18:40:55 -07003#include <gtest/gtest.h>
4
William A. Kennington IIIfd862be2022-10-09 18:40:55 -07005namespace phosphor::network::system
6{
7namespace detail
8{
9
William A. Kennington III6a923632022-11-06 18:17:33 -080010TEST(ValidateNewAddr, Filtering)
11{
12 AddressInfo info = {};
13 EXPECT_TRUE(validateNewAddr(info, {}));
14
15 info.ifidx = 2;
16 EXPECT_TRUE(validateNewAddr(info, {}));
17 EXPECT_TRUE(validateNewAddr(info, {.ifidx = 2}));
18 EXPECT_FALSE(validateNewAddr(info, {.ifidx = 3}));
19}
20
William A. Kennington IIIa8426902022-11-07 15:37:41 -080021TEST(ValidateNewNeigh, Filtering)
22{
23 NeighborInfo info = {};
24 EXPECT_TRUE(validateNewNeigh(info, {}));
25
26 info.ifidx = 2;
27 EXPECT_TRUE(validateNewNeigh(info, {}));
28 EXPECT_TRUE(validateNewNeigh(info, {.ifidx = 2}));
29 EXPECT_FALSE(validateNewNeigh(info, {.ifidx = 3}));
30}
31
William A. Kennington IIIfd862be2022-10-09 18:40:55 -070032} // namespace detail
33} // namespace phosphor::network::system