20 #include "ns3/config.h"
22 #include "ns3/integer.h"
23 #include "ns3/traced-value.h"
24 #include "ns3/trace-source-accessor.h"
25 #include "ns3/callback.h"
27 #include "ns3/singleton.h"
28 #include "ns3/object.h"
29 #include "ns3/object-vector.h"
30 #include "ns3/names.h"
31 #include "ns3/pointer.h"
45 static TypeId GetTypeId (
void);
53 int8_t GetA (
void)
const;
54 int8_t GetB (
void)
const;
71 .AddAttribute (
"NodesA",
"",
74 MakeObjectVectorChecker<ConfigTestObject> ())
75 .AddAttribute (
"NodesB",
"",
78 MakeObjectVectorChecker<ConfigTestObject> ())
79 .AddAttribute (
"NodeA",
"",
82 MakePointerChecker<ConfigTestObject> ())
83 .AddAttribute (
"NodeB",
"",
86 MakePointerChecker<ConfigTestObject> ())
87 .AddAttribute (
"A",
"",
90 MakeIntegerChecker<int8_t> ())
91 .AddAttribute (
"B",
"",
94 MakeIntegerChecker<int8_t> ())
95 .AddAttribute (
"Source",
"XX",
98 MakeIntegerChecker<int16_t> ())
99 .AddTraceSource (
"Source",
"XX",
101 "ns3::TracedValue::Int16Callback")
121 m_nodesA.push_back (a);
127 m_nodesB.push_back (b);
148 static TypeId GetTypeId (
void);
165 static TypeId GetTypeId (
void);
178 .AddAttribute (
"X",
"",
181 MakeIntegerChecker<int8_t> ())
189 static TypeId GetTypeId (
void);
214 virtual void DoRun (
void);
218 :
TestCase (
"Check ability to register a root namespace and use it")
272 virtual void DoRun (
void);
276 :
TestCase (
"Check ability to register an object under the root namespace and use it")
344 b->GetAttribute (
"B", iv);
355 b->GetAttribute (
"A", iv);
357 b->GetAttribute (
"B", iv);
367 b->GetAttribute (
"A", iv);
381 virtual void DoRun (
void);
385 :
TestCase (
"Check ability to configure vectors of Object using regular expressions")
434 obj1->GetAttribute (
"A", iv);
437 obj2->GetAttribute (
"A", iv);
440 obj3->GetAttribute (
"A", iv);
451 obj1->GetAttribute (
"A", iv);
454 obj2->GetAttribute (
"A", iv);
457 obj3->GetAttribute (
"A", iv);
467 obj1->GetAttribute (
"A", iv);
470 obj2->GetAttribute (
"A", iv);
473 obj3->GetAttribute (
"A", iv);
483 obj1->GetAttribute (
"A", iv);
486 obj2->GetAttribute (
"A", iv);
489 obj3->GetAttribute (
"A", iv);
499 obj1->GetAttribute (
"A", iv);
502 obj2->GetAttribute (
"A", iv);
505 obj3->GetAttribute (
"A", iv);
515 obj1->GetAttribute (
"A", iv);
518 obj2->GetAttribute (
"A", iv);
521 obj3->GetAttribute (
"A", iv);
538 virtual void DoRun (
void);
545 :
TestCase (
"Check ability to trace connect through vectors of Object using regular expressions")
686 virtual void DoRun (
void);
691 :
TestCase (
"Check that attributes of base class are searchable from paths including objects of derived class")
UnderRootNamespaceConfigTestCase()
virtual ~SearchAttributesOfParentObjectsTestCase()
Ptr< ConfigTestObject > m_nodeA
virtual void DoRun(void)
Implementation to actually run this TestCase.
static ConfigTestSuite configTestSuite
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Hold a signed integer type.
void AddNodeA(Ptr< ConfigTestObject > a)
void Set(std::string path, const AttributeValue &value)
void Connect(std::string path, const CallbackBase &cb)
void AddNodeB(Ptr< ConfigTestObject > b)
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
virtual ~ObjectVectorConfigTestCase()
Ptr< const AttributeAccessor > MakeIntegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
static TypeId GetTypeId(void)
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual void DoRun(void)
Implementation to actually run this TestCase.
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
static TypeId GetTypeId(void)
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
virtual ~RootNamespaceConfigTestCase()
static TypeId GetTypeId(void)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
std::vector< Ptr< ConfigTestObject > > m_nodesA
RootNamespaceConfigTestCase()
DerivedConfigTestObject(void)
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
virtual ~ObjectVectorTraceConfigTestCase()
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Hold objects of type Ptr.
virtual ~DerivedConfigObject(void)
static TypeId GetTypeId(void)
virtual ~BaseConfigObject(void)
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
Ptr< ConfigTestObject > m_nodeB
virtual void DoRun(void)
Implementation to actually run this TestCase.
DerivedConfigObject(void)
virtual ~DerivedConfigTestObject(void)
void RegisterRootNamespaceObject(Ptr< Object > obj)
ObjectVectorTraceConfigTestCase()
void TraceWithPath(std::string path, int16_t old, int16_t newValue)
virtual void DoRun(void)
Implementation to actually run this TestCase.
A base class which provides memory management and object aggregation.
virtual ~UnderRootNamespaceConfigTestCase()
SearchAttributesOfParentObjectsTestCase()
Container for a set of ns3::Object pointers.
void SetNodeA(Ptr< ConfigTestObject > a)
ObjectVectorConfigTestCase()
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
virtual void DoRun(void)
Implementation to actually run this TestCase.
void Trace(int16_t oldValue, int16_t newValue)
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
void SetNodeB(Ptr< ConfigTestObject > b)
std::vector< Ptr< ConfigTestObject > > m_nodesB
TracedValue< int16_t > m_trace