A Discrete-Event Network Simulator
API
pcap-test.h File Reference
#include <sstream>
#include <string>
#include <stdint.h>
#include "pcap-file.h"
#include "ns3/test.h"
+ Include dependency graph for pcap-test.h:

Go to the source code of this file.

Macros

#define NS_PCAP_TEST_EXPECT_EQ(filename)
 Test that a pair of reference/new pcap files are equal. More...
 

Macro Definition Documentation

◆ NS_PCAP_TEST_EXPECT_EQ

#define NS_PCAP_TEST_EXPECT_EQ (   filename)
Value:
do { \
std::ostringstream oss; \
oss << filename; \
std::string expected = CreateDataDirFilename (oss.str()); \
std::string got = CreateTempDirFilename (oss.str()); \
uint32_t sec(0), usec(0), packets(0); \ \
bool diff = PcapFile::Diff (got, expected, sec, usec, packets); \
NS_TEST_EXPECT_MSG_EQ (diff, false, \
"PCAP traces " \
<< got << " and " << expected \
<< " differ starting from packet " \
<< packets << " at " << sec << " s " \
<< usec << " us"); \
} while (false)

Test that a pair of reference/new pcap files are equal.

The filename is interpreted as a stream.

Parameters
filenameThe name of the file to read in the reference/temporary directories

Definition at line 38 of file pcap-test.h.