A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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

namespace  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.
 

Macro Definition Documentation

◆ CHECK

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

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

Referenced by PacketTest::DoRun().

◆ CHECK_DATA

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

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

Referenced by PacketTest::DoRun().

◆ E

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

◆ E_DATA

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

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

Referenced by PacketTest::DoRun().

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

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

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"); \
}
bool Replace(Tag &tag)
Replace the value of a tag.

Referenced by PacketTagListTest::DoRun().

Variable Documentation

◆ g_packetTestSuite

PacketTestSuite g_packetTestSuite
static

Static variable for test initialization.

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