A Discrete-Event Network Simulator
API
packet-test-suite.cc File Reference
#include "ns3/packet-tag-list.h"
#include "ns3/packet.h"
#include "ns3/test.h"
#include <cstdarg>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <limits>
#include <string>
+ Include dependency graph for packet-test-suite.cc:

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, n, __VA_ARGS__)
 
#define CHECK_DATA(p, n, ...)   DoCheckData(p, n, __VA_ARGS__)
 
#define E(name, start, end)   name, start, end
 
#define E_DATA(name, start, end, data)   name, start, end, data
 
#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, n, __VA_ARGS__)

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

◆ CHECK_DATA

#define CHECK_DATA (   p,
  n,
  ... 
)    DoCheckData(p, n, __VA_ARGS__)

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

◆ E

#define E (   name,
  start,
  end 
)    name, start, end

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

◆ E_DATA

#define E_DATA (   name,
  start,
  end,
  data 
)    name, start, end, data

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

◆ LARGE_TAG_BUFFER_SIZE

#define LARGE_TAG_BUFFER_SIZE   64

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

◆ 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); \
constexpr int TAG_LAST [[maybe_unused]] = 7; /* length of ref PacketTagList */

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

◆ 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.
bool Remove(Tag &tag)
Remove (the first instance of) tag from the list.

◆ 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"); \
}

Variable Documentation

◆ g_packetTestSuite

PacketTestSuite g_packetTestSuite
static

Static variable for test initialization.

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