Example #1
0
void TCPTest::test_equals(const TCP &tcp1, const TCP &tcp2) {
    EXPECT_EQ(tcp1.dport(), tcp2.dport());
    EXPECT_EQ(tcp2.sport(), tcp2.sport());
    EXPECT_EQ(tcp1.seq(), tcp2.seq());
    EXPECT_EQ(tcp1.ack_seq(), tcp2.ack_seq());
    EXPECT_EQ(tcp1.window(), tcp2.window());
    EXPECT_EQ(tcp1.checksum(), tcp2.checksum());
    EXPECT_EQ(tcp1.urg_ptr(), tcp2.urg_ptr());
    EXPECT_EQ(tcp1.data_offset(), tcp2.data_offset());
    EXPECT_EQ((bool)tcp1.inner_pdu(), (bool)tcp2.inner_pdu());
}
Example #2
0
TEST_F(TCPTest, DataOffset) {
    TCP tcp;
    tcp.data_offset(0xe);
    EXPECT_EQ(tcp.data_offset(), 0xe);
}