blob: 70eef05e3941eb0475c5c7a277912e94e0d2dcd8 [file] [log] [blame]
William A. Kennington III7d6fa422021-02-08 17:04:02 -08001#include "net_iface_mock.h"
2
3#include <gtest/gtest.h>
4
5TEST(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
15TEST(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}