1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-30 13:34:27 +01:00

Removed PDU::clone_packet and renamed PDU::clone_pdu to PDU::clone.

This commit is contained in:
Matias Fontanini
2012-09-11 16:54:14 -03:00
parent 7cbd32361a
commit e8151724c4
38 changed files with 106 additions and 117 deletions

View File

@@ -83,7 +83,7 @@ TEST_F(Dot11AckTest, CopyAssignmentOperator) {
TEST_F(Dot11AckTest, ClonePDU) {
Dot11Ack dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11Ack> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11Ack> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -73,7 +73,7 @@ TEST_F(Dot11AssocRequestTest, ListenInterval) {
TEST_F(Dot11AssocRequestTest, ClonePDU) {
Dot11AssocRequest dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11AssocRequest> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11AssocRequest> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -81,7 +81,7 @@ TEST_F(Dot11AssocResponseTest, AID) {
TEST_F(Dot11AssocResponseTest, ClonePDU) {
Dot11AssocResponse dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11AssocResponse> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11AssocResponse> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -89,7 +89,7 @@ TEST_F(Dot11AuthenticationTest, AuthAlgorithm) {
TEST_F(Dot11AuthenticationTest, ClonePDU) {
Dot11Authentication dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11Authentication> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11Authentication> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -78,7 +78,7 @@ TEST_F(Dot11BlockAckRequestTest, ClonePDU) {
dot1.fragment_number(6);
dot1.start_sequence(0x294);
dot1.bar_control(0x92f);
std::auto_ptr<Dot11BlockAckRequest> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11BlockAckRequest> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -60,7 +60,7 @@ TEST_F(Dot11CFEndTest, CopyAssignmentOperator) {
TEST_F(Dot11CFEndTest, ClonePDU) {
Dot11CFEnd dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11CFEnd> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11CFEnd> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -60,7 +60,7 @@ TEST_F(Dot11EndCFAckTest, CopyAssignmentOperator) {
TEST_F(Dot11EndCFAckTest, ClonePDU) {
Dot11EndCFAck dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11EndCFAck> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11EndCFAck> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -49,7 +49,7 @@ TEST_F(Dot11DataTest, CopyAssignmentOperator) {
TEST_F(Dot11DataTest, ClonePDU) {
Dot11Data dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11Data> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11Data> dot2(dot1.clone());
test_equals(dot1, *dot2);
}
@@ -89,7 +89,7 @@ TEST_F(Dot11DataTest, PCAPLoad1) {
EXPECT_EQ(dot1.from_ds(), 1);
EXPECT_EQ(dot1.frag_num(), 0);
EXPECT_EQ(dot1.seq_num(), 1945);
std::auto_ptr<Dot11Data> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11Data> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -71,7 +71,7 @@ TEST_F(Dot11DeauthenticationTest, ReasonCode) {
TEST_F(Dot11DeauthenticationTest, ClonePDU) {
Dot11Deauthentication dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11Deauthentication> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11Deauthentication> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -71,7 +71,7 @@ TEST_F(Dot11DisassocTest, ReasonCode) {
TEST_F(Dot11DisassocTest, ClonePDU) {
Dot11Disassoc dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11Disassoc> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11Disassoc> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -61,7 +61,7 @@ TEST_F(Dot11ProbeRequestTest, CopyAssignmentOperator) {
TEST_F(Dot11ProbeRequestTest, ClonePDU) {
Dot11ProbeRequest dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11ProbeRequest> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11ProbeRequest> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -81,7 +81,7 @@ TEST_F(Dot11ProbeResponseTest, Timestamp) {
TEST_F(Dot11ProbeResponseTest, ClonePDU) {
Dot11ProbeResponse dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11ProbeResponse> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11ProbeResponse> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -60,7 +60,7 @@ TEST_F(Dot11PSPollTest, CopyAssignmentOperator) {
TEST_F(Dot11PSPollTest, ClonePDU) {
Dot11PSPoll dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11PSPoll> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11PSPoll> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -80,7 +80,7 @@ TEST_F(Dot11ReAssocRequestTest, CurrentAP) {
TEST_F(Dot11ReAssocRequestTest, ClonePDU) {
Dot11ReAssocRequest dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11ReAssocRequest> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11ReAssocRequest> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -69,7 +69,7 @@ TEST_F(Dot11ReAssocResponseTest, CopyAssignmentOperator) {
TEST_F(Dot11ReAssocResponseTest, ClonePDU) {
Dot11ReAssocResponse dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11ReAssocResponse> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11ReAssocResponse> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -60,7 +60,7 @@ TEST_F(Dot11RTSTest, CopyAssignmentOperator) {
TEST_F(Dot11RTSTest, ClonePDU) {
Dot11RTS dot1(expected_packet, sizeof(expected_packet));
std::auto_ptr<Dot11RTS> dot2(dot1.clone_pdu());
std::auto_ptr<Dot11RTS> dot2(dot1.clone());
test_equals(dot1, *dot2);
}

View File

@@ -78,7 +78,7 @@ TEST_F(SNAPTest, ClonePDU) {
snap1.eth_type(0xfab1);
snap1.org_code(0xfab1c3);
snap1.control(0x1);
SNAP *snap2 = static_cast<SNAP*>(snap1.clone_pdu());
SNAP *snap2 = static_cast<SNAP*>(snap1.clone());
ASSERT_TRUE(snap2);
test_equals(snap1, *snap2);

View File

@@ -89,7 +89,7 @@ TEST_F(UDPTest, ClonePDU) {
udp1.sport(sport);
udp1.length(length);
UDP *udp2 = static_cast<UDP*>(udp1.clone_pdu());
UDP *udp2 = static_cast<UDP*>(udp1.clone());
ASSERT_TRUE(udp2);
EXPECT_EQ(udp2->sport(), sport);
EXPECT_EQ(udp2->dport(), dport);