William A. Kennington III | 7d6fa42 | 2021-02-08 17:04:02 -0800 | [diff] [blame] | 1 | #include "net_iface_mock.h" |
| 2 | |
| 3 | #include <gtest/gtest.h> |
| 4 | |
| 5 | TEST(TestIFace, TestGetIndex) |
| 6 | { |
| 7 | mock::IFace iface_mock; |
| 8 | |
| 9 | constexpr int test_index = 5; |
| 10 | iface_mock.index = test_index; |
| 11 | |
| 12 | EXPECT_EQ(test_index, iface_mock.get_index()); |
| 13 | } |
| 14 | |
| 15 | TEST(TestIFace, TestSetClearFlags) |
| 16 | { |
| 17 | mock::IFace iface_mock; |
| 18 | |
| 19 | const short new_flags = 0xab; |
| 20 | iface_mock.set_sock_flags(0, new_flags); |
| 21 | EXPECT_EQ(new_flags, new_flags & iface_mock.flags); |
| 22 | iface_mock.clear_sock_flags(0, 0xa0); |
| 23 | EXPECT_EQ(0xb, new_flags & iface_mock.flags); |
| 24 | } |