From: Christian Herdtweck Date: Thu, 19 Mar 2015 09:13:11 +0000 (+0100) Subject: created data directory in test directory for pcap files for IcmpPacket tests X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=b138f26a9144317c115ba9bbe172db438b706d96;p=pingcheck created data directory in test directory for pcap files for IcmpPacket tests --- 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/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};