made nicer static variables of packet dump mode and location
[pingcheck] / test / test_icmppacket.cpp
index 692586e..6dd6f4d 100644 (file)
 #include "tools/pcap.h"
 
 //------------------------------------------------------------------------------
-//  helper function and consts
+//  helper function
 //------------------------------------------------------------------------------
 
-const int DUMP_MODE_NO_DUMP = 0;
-
 IcmpPacketItem read_packet(const std::string &file_name);
 
 
@@ -60,8 +58,10 @@ IcmpPacketItem read_packet(const std::string &file_name)
         BOOST_FAIL( "Failed to recognize/consume pcap header!" );
     }
 
+    IcmpPacketFactory::PacketDumpMode = DUMP_NEVER;
+
     IcmpPacketItem packet = IcmpPacketFactory::create_icmp_packet(
-            boost::asio::ip::icmp::v4(), file_stream, DUMP_MODE_NO_DUMP);
+                                      boost::asio::ip::icmp::v4(), file_stream);
     file_stream.close();
 
     // managed to create packet from rest of file contents?