A Discrete-Event Network Simulator
API
Classes | Namespaces | Macros | Variables
packet-test-suite.cc File Reference
#include "ns3/packet.h"
#include "ns3/packet-tag-list.h"
#include "ns3/test.h"
#include "ns3/unused.h"
#include <limits>
#include <string>
#include <cstdarg>
#include <iostream>
#include <iomanip>
#include <ctime>

Go to the source code of this file.

Classes

class  anonymous_namespace{packet-test-suite.cc}::ALargeTestTag
 Template class for Large Test tags. More...
 
class  anonymous_namespace{packet-test-suite.cc}::ATestHeader< N >
 Template class for Test headers. More...
 
class  anonymous_namespace{packet-test-suite.cc}::ATestHeaderBase
 Base class for Test headers. More...
 
class  anonymous_namespace{packet-test-suite.cc}::ATestTag< N >
 Template class for Test tags. More...
 
class  anonymous_namespace{packet-test-suite.cc}::ATestTagBase
 Base class for Test tags. More...
 
class  anonymous_namespace{packet-test-suite.cc}::ATestTrailer< N >
 Template class for Test trailers. More...
 
class  anonymous_namespace{packet-test-suite.cc}::ATestTrailerBase
 Base class for Test trailers. More...
 
struct  anonymous_namespace{packet-test-suite.cc}::Expected
 Struct to hold the expected data in the packet. More...
 
class  PacketTagListTest
 Packet Tag list unit tests. More...
 
class  PacketTest
 Packet unit tests. More...
 
class  PacketTestSuite
 Packet TestSuite. More...
 

Namespaces

 anonymous_namespace{packet-test-suite.cc}
 

Macros

#define CHECK(p, n, ...)   DoCheck (p, __FILE__, __LINE__, n, __VA_ARGS__)
 
#define E(a, b, c)   a,b,c
 
#define LARGE_TAG_BUFFER_SIZE   64
 
#define MAKE_TEST_TAGS
 
#define RemoveCheck(n)
 
#define ReplaceCheck(n)
 

Variables

static PacketTestSuite g_packetTestSuite
 Static variable for test initialization. More...
 

Macro Definition Documentation

◆ CHECK

#define CHECK (   p,
  n,
  ... 
)    DoCheck (p, __FILE__, __LINE__, n, __VA_ARGS__)

Definition at line 409 of file packet-test-suite.cc.

Referenced by PacketTest::DoRun().

◆ E

#define E (   a,
  b,
 
)    a,b,c

Definition at line 407 of file packet-test-suite.cc.

Referenced by PacketTest::DoRun(), and ns3::LiIonEnergySource::GetVoltage().

◆ LARGE_TAG_BUFFER_SIZE

#define LARGE_TAG_BUFFER_SIZE   64

◆ MAKE_TEST_TAGS

#define MAKE_TEST_TAGS
Value:
ATestTag<1> t1 (1); \
ATestTag<2> t2 (1); \
ATestTag<3> t3 (1); \
ATestTag<4> t4 (1); \
ATestTag<5> t5 (1); \
ATestTag<6> t6 (1); \
ATestTag<7> t7 (1); \
const int tagLast = 7; /* length of ref PacketTagList */ \
NS_UNUSED (tagLast) /* silence warnings */

Definition at line 823 of file packet-test-suite.cc.

Referenced by PacketTagListTest::CheckRefList(), and PacketTagListTest::DoRun().

◆ RemoveCheck

#define RemoveCheck (   n)
Value:
{ PacketTagList p ## n = ref; \
p ## n .Remove ( t ## n ); \
CheckRefList (ref, "remove " #n " orig"); \
CheckRefList (p ## n, "remove " #n " copy", n); \
}
List of the packet tags stored in a packet.

Referenced by PacketTagListTest::DoRun().

◆ ReplaceCheck

#define ReplaceCheck (   n)
Value:
t ## n .m_data = 2; \
{ PacketTagList p ## n = ref; \
p ## n .Replace ( t ## n ); \
CheckRefList (ref, "replace " #n " orig"); \
CheckRef (p ## n, t ## n, "replace " #n " copy"); \
}
List of the packet tags stored in a packet.

Referenced by PacketTagListTest::DoRun().

Variable Documentation

◆ g_packetTestSuite

PacketTestSuite g_packetTestSuite
static

Static variable for test initialization.

Definition at line 1057 of file packet-test-suite.cc.