mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Fix active tests build issues
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
INCLUDE_DIRECTORIES(${gtest_INCLUDE_DIRS})
|
||||
ADD_SUBDIRECTORY(src)
|
||||
ADD_SUBDIRECTORY(active_tests)
|
||||
|
||||
IF (ENABLE_ACTIVE_TESTS)
|
||||
ADD_SUBDIRECTORY(active_tests)
|
||||
ENDIF()
|
||||
@@ -43,7 +43,9 @@ class PDU;
|
||||
|
||||
class TestFailed : public std::runtime_error {
|
||||
public:
|
||||
using std::runtime_error::runtime_error;
|
||||
TestFailed(const std::string& message) : std::runtime_error(message) {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
class ActiveTest {
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
|
||||
class IPv4SourceAddressTest : public ActiveTest {
|
||||
public:
|
||||
using ActiveTest::ActiveTest;
|
||||
IPv4SourceAddressTest(const PacketSenderPtr& packet_sender,
|
||||
const ConfigurationPtr& configuration);
|
||||
|
||||
std::string name() const;
|
||||
private:
|
||||
@@ -47,7 +48,8 @@ private:
|
||||
|
||||
class IPv4FragmentationTest : public ActiveTest {
|
||||
public:
|
||||
using ActiveTest::ActiveTest;
|
||||
IPv4FragmentationTest(const PacketSenderPtr& packet_sender,
|
||||
const ConfigurationPtr& configuration);
|
||||
|
||||
std::string name() const;
|
||||
private:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
FILE(GLOB SOURCES "*.cpp")
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${PROJECT_SOURCE_DIR}/include/
|
||||
${PCAP_INCLUDE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
||||
)
|
||||
|
||||
@@ -14,4 +16,4 @@ LINK_LIBRARIES(
|
||||
${PCAP_LIBRARY}
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(active_tester EXCLUDE_FROM_ALL ${SOURCES})
|
||||
ADD_EXECUTABLE(active_tester EXCLUDE_FROM_ALL ${SOURCES})
|
||||
|
||||
@@ -48,6 +48,12 @@ using Tins::NetworkInterface;
|
||||
|
||||
// Source address test
|
||||
|
||||
IPv4SourceAddressTest::IPv4SourceAddressTest(const PacketSenderPtr& packet_sender,
|
||||
const ConfigurationPtr& configuration)
|
||||
: ActiveTest(packet_sender, configuration) {
|
||||
|
||||
}
|
||||
|
||||
string IPv4SourceAddressTest::name() const {
|
||||
return "ipv4_source_address";
|
||||
}
|
||||
@@ -81,6 +87,12 @@ bool IPv4SourceAddressTest::test_matches_packet(const PDU& pdu) const {
|
||||
|
||||
// Fragmentation test
|
||||
|
||||
IPv4FragmentationTest::IPv4FragmentationTest(const PacketSenderPtr& packet_sender,
|
||||
const ConfigurationPtr& configuration)
|
||||
: ActiveTest(packet_sender, configuration) {
|
||||
|
||||
}
|
||||
|
||||
string IPv4FragmentationTest::name() const {
|
||||
return "ipv4_fragmentation";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user