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")
53 .AddConstructor<SequenceNumberTestObj>();
65 m_testTracedSequenceNumber += 1;
92 void DoRun()
override;
96 :
TestCase(
"Sequence number test case")
116#define SEQ_TEST_ASSERT_EQUAL(a, b) NS_TEST_ASSERT_MSG_EQ(a, b, "foo")
117#define SEQ_TEST_ASSERT(a) NS_TEST_ASSERT_MSG_EQ(bool(a), true, "foo")
124 value = (num1 + num2).GetValue();
198 obj->TraceConnectWithoutContext(
199 "TestTracedSequenceNumber",
201 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()
Test object using sequence numbers.
TracedValue< SequenceNumber32 > m_testTracedSequenceNumber
Test traced sequence number.
void IncSequenceNumber()
Increment the sequence number.
static TypeId GetTypeId()
Get the type ID.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
A base class which provides memory management and object aggregation.
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.
static constexpr auto UNIT
Trace classes with value semantics.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
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.
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...
#define SEQ_TEST_ASSERT_EQUAL(a, b)
static SequenceNumberTestSuite g_seqNumTests
Static variable for test initialization.
#define SEQ_TEST_ASSERT(a)