William A. Kennington III | fd862be | 2022-10-09 18:40:55 -0700 | [diff] [blame] | 1 | #include "system_queries.hpp" |
| 2 | |
William A. Kennington III | fd862be | 2022-10-09 18:40:55 -0700 | [diff] [blame] | 3 | #include <gtest/gtest.h> |
| 4 | |
William A. Kennington III | fd862be | 2022-10-09 18:40:55 -0700 | [diff] [blame] | 5 | namespace phosphor::network::system |
| 6 | { |
| 7 | namespace detail |
| 8 | { |
| 9 | |
William A. Kennington III | 6a92363 | 2022-11-06 18:17:33 -0800 | [diff] [blame] | 10 | TEST(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 III | a842690 | 2022-11-07 15:37:41 -0800 | [diff] [blame] | 21 | TEST(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 III | fd862be | 2022-10-09 18:40:55 -0700 | [diff] [blame] | 32 | } // namespace detail |
| 33 | } // namespace phosphor::network::system |