10#include "ns3/sequence-number.h"
12#include "ns3/trace-source-accessor.h"
13#include "ns3/traced-value.h"
46 TypeId(
"ns3::SequenceNumberTestObj")
49 "TestTracedSequenceNumber",
50 "A traceable sequence number",
52 "ns3::SequenceNumber32TracedValueCallback")
87 void DoRun()
override;
91 :
TestCase(
"Sequence number test case")
111#define SEQ_TEST_ASSERT_EQUAL(a, b) NS_TEST_ASSERT_MSG_EQ(a, b, "foo")
112#define SEQ_TEST_ASSERT(a) NS_TEST_ASSERT_MSG_EQ(bool(a), true, "foo")
119 value = (num1 + num2).GetValue();
193 obj->TraceConnectWithoutContext(
194 "TestTracedSequenceNumber",
196 obj->IncSequenceNumber();
Sequence Number Unit Test.
~SequenceNumberTestCase() override
void DoRun() override
Implementation to actually run this TestCase.
SequenceNumber32 m_oldval
Old value.
void SequenceNumberTracer(SequenceNumber32 oldval, SequenceNumber32 newval)
Sequence number tracker.
SequenceNumber32 m_newval
New value.
Sequence Number TestSuite.
SequenceNumberTestSuite()
TracedValue< SequenceNumber32 > m_testTracedSequenceNumber
Test traced sequence number.
void IncSequenceNumber()
Increment the sequence number.
static TypeId GetTypeId()
Get the type ID.
Object()
Caller graph was not generated because of its size.
Smart pointer class similar to boost::intrusive_ptr.
NUMERIC_TYPE GetValue() const
Extracts the numeric value of the sequence number.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
@ UNIT
This test suite implements a Unit Test.
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Trace classes with value semantics.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
SequenceNumber< uint16_t, int16_t > SequenceNumber16
16 bit Sequence number.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
#define SEQ_TEST_ASSERT_EQUAL(a, b)
static SequenceNumberTestSuite g_seqNumTests
Static variable for test initialization.
#define SEQ_TEST_ASSERT(a)