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",
120 m_nodesA.push_back (a);
126 m_nodesB.push_back (b);
151 virtual void DoRun (
void);
155 :
TestCase (
"Check ability to register a root namespace and use it")
209 virtual void DoRun (
void);
213 :
TestCase (
"Check ability to register an object under the root namespace and use it")
281 b->GetAttribute (
"B", iv);
292 b->GetAttribute (
"A", iv);
294 b->GetAttribute (
"B", iv);
304 b->GetAttribute (
"A", iv);
318 virtual void DoRun (
void);
322 :
TestCase (
"Check ability to configure vectors of Object using regular expressions")
371 obj1->GetAttribute (
"A", iv);
374 obj2->GetAttribute (
"A", iv);
377 obj3->GetAttribute (
"A", iv);
388 obj1->GetAttribute (
"A", iv);
391 obj2->GetAttribute (
"A", iv);
394 obj3->GetAttribute (
"A", iv);
404 obj1->GetAttribute (
"A", iv);
407 obj2->GetAttribute (
"A", iv);
410 obj3->GetAttribute (
"A", iv);
420 obj1->GetAttribute (
"A", iv);
423 obj2->GetAttribute (
"A", iv);
426 obj3->GetAttribute (
"A", iv);
436 obj1->GetAttribute (
"A", iv);
439 obj2->GetAttribute (
"A", iv);
442 obj3->GetAttribute (
"A", iv);
452 obj1->GetAttribute (
"A", iv);
455 obj2->GetAttribute (
"A", iv);
458 obj3->GetAttribute (
"A", iv);
475 virtual void DoRun (
void);
482 :
TestCase (
"Check ability to trace connect through vectors of Object using regular expressions")
UnderRootNamespaceConfigTestCase()
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberContainer)
Ptr< ConfigTestObject > m_nodeA
static ConfigTestSuite configTestSuite
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)
virtual ~ObjectVectorConfigTestCase()
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~RootNamespaceConfigTestCase()
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
std::vector< Ptr< ConfigTestObject > > m_nodesA
RootNamespaceConfigTestCase()
virtual ~ObjectVectorTraceConfigTestCase()
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
static TypeId GetTypeId(void)
void GetAttribute(std::string name, AttributeValue &value) const
Ptr< ConfigTestObject > m_nodeB
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
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()
contain a set of ns3::Object pointers.
void SetNodeA(Ptr< ConfigTestObject > a)
ObjectVectorConfigTestCase()
void SetAttribute(std::string name, const AttributeValue &value)
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)
#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.
std::vector< Ptr< ConfigTestObject > > m_nodesB
TracedValue< int16_t > m_trace