1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Replaced tabs for spaces in the previous commit

This commit is contained in:
Santiago Alessandri
2013-07-14 13:13:38 -03:00
parent 02d3a14083
commit 2a5b64526f
4 changed files with 28 additions and 28 deletions

View File

@@ -39,10 +39,10 @@ EthernetIITest::ipv6_packet[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
},
EthernetIITest::smallip_packet[] = {
64, 97, 134, 43, 174, 3, 0, 36, 1, 254, 210, 68, 8, 0, 69, 0, 0, 40,
53, 163, 64, 0, 127, 6, 44, 53, 192, 168, 1, 120, 173, 194, 42, 21,
163, 42, 1, 187, 162, 113, 212, 162, 132, 15, 66, 219, 80, 16, 16,
194, 34, 54, 0, 0, 0, 0, 0, 0, 0, 0
64, 97, 134, 43, 174, 3, 0, 36, 1, 254, 210, 68, 8, 0, 69, 0, 0, 40,
53, 163, 64, 0, 127, 6, 44, 53, 192, 168, 1, 120, 173, 194, 42, 21,
163, 42, 1, 187, 162, 113, 212, 162, 132, 15, 66, 219, 80, 16, 16,
194, 34, 54, 0, 0, 0, 0, 0, 0, 0, 0
};
address_type EthernetIITest::src_addr("8a:8b:8c:8d:8e:8f");
@@ -125,11 +125,11 @@ TEST_F(EthernetIITest, Serialize) {
}
TEST_F(EthernetIITest, SerializeSmallEthernetWithPadding) {
EthernetII eth(smallip_packet, sizeof(smallip_packet));
ASSERT_TRUE(eth.inner_pdu());
PDU::serialization_type serialized = eth.serialize();
EXPECT_EQ(serialized.size(), sizeof(smallip_packet));
EXPECT_TRUE(std::equal(serialized.begin(), serialized.end(), smallip_packet));
EthernetII eth(smallip_packet, sizeof(smallip_packet));
ASSERT_TRUE(eth.inner_pdu());
PDU::serialization_type serialized = eth.serialize();
EXPECT_EQ(serialized.size(), sizeof(smallip_packet));
EXPECT_TRUE(std::equal(serialized.begin(), serialized.end(), smallip_packet));
}
TEST_F(EthernetIITest, ConstructorFromBuffer) {
@@ -152,9 +152,9 @@ TEST_F(EthernetIITest, ConstructorFromIPv6Buffer) {
}
TEST_F(EthernetIITest, EliminateEthernetPadding) {
EthernetII eth(smallip_packet, sizeof(smallip_packet));
ASSERT_TRUE(eth.inner_pdu());
ASSERT_TRUE(eth.find_pdu<IP>());
ASSERT_TRUE(eth.find_pdu<TCP>());
ASSERT_FALSE(eth.find_pdu<RawPDU>());
EthernetII eth(smallip_packet, sizeof(smallip_packet));
ASSERT_TRUE(eth.inner_pdu());
ASSERT_TRUE(eth.find_pdu<IP>());
ASSERT_TRUE(eth.find_pdu<TCP>());
ASSERT_FALSE(eth.find_pdu<RawPDU>());
}

View File

@@ -48,14 +48,14 @@ TEST_F(PPPoETest, StackedOnEthernet) {
TEST_F(PPPoETest, StackedOnEthernetSerializationWithTags) {
PPPoE pdu(expected_packet, sizeof(expected_packet));
EthernetII eth = EthernetII() / pdu;
EthernetII eth = EthernetII() / pdu;
PDU::serialization_type buffer = eth.serialize();
EthernetII eth2(&buffer[0], buffer.size());
PPPoE* unserialized = eth2.find_pdu<PPPoE>();
ASSERT_TRUE(unserialized);
EXPECT_EQ(
PPPoE::serialization_type(expected_packet, expected_packet + sizeof(expected_packet)),
unserialized->serialize()
PPPoE::serialization_type(expected_packet, expected_packet + sizeof(expected_packet)),
unserialized->serialize()
);
}