From b138f26a9144317c115ba9bbe172db438b706d96 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Thu, 19 Mar 2015 10:13:11 +0100 Subject: [PATCH] created data directory in test directory for pcap files for IcmpPacket tests --- test/CMakeLists.test_icmppacket.txt | 15 ++++++++++++++- test/data/CMakeLists.txt | 1 + test/data/icmp_echorequest.pcap | Bin 0 -> 94 bytes test/test_icmppacket.cpp | 2 +- test/test_icmppacket_echorequest.pcap | Bin 94 -> 0 bytes 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 test/data/CMakeLists.txt create mode 100644 test/data/icmp_echorequest.pcap delete mode 100644 test/test_icmppacket_echorequest.pcap diff --git a/test/CMakeLists.test_icmppacket.txt b/test/CMakeLists.test_icmppacket.txt index 4f548b9..822ab62 100644 --- a/test/CMakeLists.test_icmppacket.txt +++ b/test/CMakeLists.test_icmppacket.txt @@ -1,8 +1,19 @@ # compiler: creates the binaries add_executable(test_icmppacket - test_icmppacket.cpp ${CMAKE_SOURCE_DIR}/src/boost_assert_handler.cpp + ${CMAKE_SOURCE_DIR}/src/host/messagepayload.cpp + ${CMAKE_SOURCE_DIR}/src/ip/ipheader.cpp + ${CMAKE_SOURCE_DIR}/src/ip/ipv4header.cpp + ${CMAKE_SOURCE_DIR}/src/ip/ipv6header.cpp ${CMAKE_SOURCE_DIR}/src/icmp/icmppacket.cpp + ${CMAKE_SOURCE_DIR}/src/icmp/icmpheader.cpp + ${CMAKE_SOURCE_DIR}/src/icmp/icmpdata.cpp + ${CMAKE_SOURCE_DIR}/src/icmp/icmpdata_pingfailreply.cpp + ${CMAKE_SOURCE_DIR}/src/icmp/icmpechodata.cpp + ${CMAKE_SOURCE_DIR}/src/icmp/icmpdestinationunreachabledata.cpp + ${CMAKE_SOURCE_DIR}/src/icmp/icmptimeexceededdata.cpp + ${CMAKE_SOURCE_DIR}/src/icmp/icmppacketfactory.cpp + test_icmppacket.cpp ) # linker: link the program against the libraries @@ -14,3 +25,5 @@ target_link_libraries( # cmake: invocation via "make test" add_test(test_icmppacket test_icmppacket) + +add_subdirectory(data) diff --git a/test/data/CMakeLists.txt b/test/data/CMakeLists.txt new file mode 100644 index 0000000..bf94587 --- /dev/null +++ b/test/data/CMakeLists.txt @@ -0,0 +1 @@ +configure_file(icmp_echorequest.pcap ${CMAKE_CURRENT_BINARY_DIR}/icmp_echorequest.pcap COPYONLY) diff --git a/test/data/icmp_echorequest.pcap b/test/data/icmp_echorequest.pcap new file mode 100644 index 0000000000000000000000000000000000000000..bd34339aedf65095761ef6900f95b824b71e397a GIT binary patch literal 94 zcmca|c+)~A1{MYw`2U}Qff2}=w1YFWV*?9=8ITRaEhf_i8~!kXl!b9HxH2$kaHTsi lI56HxS|h;NtCrHh#li5$f4vz4V?kzKx^8Z2adBdLDggdT7jOUo literal 0 HcmV?d00001 diff --git a/test/test_icmppacket.cpp b/test/test_icmppacket.cpp index 2b6dde2..6266b25 100644 --- a/test/test_icmppacket.cpp +++ b/test/test_icmppacket.cpp @@ -35,7 +35,7 @@ // helper function and consts //------------------------------------------------------------------------------ -bool check_and_consume_pcap_headers(std::istream &input_stream); +bool check_and_consume_pcap_headers(std::ifstream &input_stream); IcmpPacketItem read_packet(const std::string &file_name); const uint8_t pcap_magic_bytes[] = {0xa1, 0xb2, 0xc3, 0xd4}; diff --git a/test/test_icmppacket_echorequest.pcap b/test/test_icmppacket_echorequest.pcap deleted file mode 100644 index bd34339aedf65095761ef6900f95b824b71e397a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 94 zcmca|c+)~A1{MYw`2U}Qff2}=w1YFWV*?9=8ITRaEhf_i8~!kXl!b9HxH2$kaHTsi lI56HxS|h;NtCrHh#li5$f4vz4V?kzKx^8Z2adBdLDggdT7jOUo -- 1.7.1