43 .HideFromDocumentation()
70 .HideFromDocumentation()
102 void DoRun()
override;
107 :
TestCase(
"Check low level Names::Add and Names::FindName functionality")
133 Names::Add(objectOne,
"Child", childOfObjectOne);
136 Names::Add(objectTwo,
"Child", childOfObjectTwo);
144 "Could not Names::Add and Names::FindName a second Object");
149 "Could not Names::Add and Names::FindName a child Object");
154 "Could not Names::Add and Names::FindName a child Object");
175 void DoRun()
override;
180 :
TestCase(
"Check string context Names::Add and Names::FindName functionality")
207 Names::Add(
"/Names/Name One",
"Child", childOfObjectOne);
210 Names::Add(
"/Names/Name Two",
"Child", childOfObjectTwo);
218 "Could not Names::Add and Names::FindName a second Object");
223 "Could not Names::Add and Names::FindName a child Object");
228 "Could not Names::Add and Names::FindName a child Object");
248 void DoRun()
override;
253 :
TestCase(
"Check fully qualified path Names::Add and Names::FindName functionality")
280 Names::Add(
"/Names/Name One/Child", childOfObjectOne);
283 Names::Add(
"/Names/Name Two/Child", childOfObjectTwo);
291 "Could not Names::Add and Names::FindName a second Object");
296 "Could not Names::Add and Names::FindName a child Object");
301 "Could not Names::Add and Names::FindName a child Object");
325 void DoRun()
override;
330 :
TestCase(
"Check relative path Names::Add and Names::FindName functionality")
357 Names::Add(
"Name One/Child", childOfObjectOne);
360 Names::Add(
"Name Two/Child", childOfObjectTwo);
368 "Could not Names::Add and Names::FindName a second Object");
373 "Could not Names::Add and Names::FindName a child Object");
378 "Could not Names::Add and Names::FindName a child Object");
399 void DoRun()
override;
404 :
TestCase(
"Check low level Names::Rename functionality")
427 Names::Add(objectOne,
"Child", childOfObjectOne);
440 "Could not Names::Add and Names::FindName a child Object");
465 void DoRun()
override;
470 :
TestCase(
"Check string context-based Names::Rename functionality")
493 Names::Add(
"/Names/Name",
"Child", childOfObjectOne);
506 "Could not Names::Add and Names::FindName a child Object");
531 void DoRun()
override;
536 :
TestCase(
"Check fully qualified path Names::Rename functionality")
559 Names::Add(
"/Names/Name/Child", childOfObjectOne);
572 "Could not Names::Add and Names::FindName a child Object");
597 void DoRun()
override;
602 :
TestCase(
"Check relative path Names::Rename functionality")
638 "Could not Names::Add and Names::FindName a child Object");
663 void DoRun()
override;
668 :
TestCase(
"Check Names::FindPath functionality")
691 Names::Add(
"/Names/Name/Child", childOfObjectOne);
696 "Could not Names::Add and Names::FindPath an Object");
701 "Could not Names::Add and Names::FindPath a child Object");
724 void DoRun()
override;
729 :
TestCase(
"Check low level Names::Find functionality")
755 Names::Add(
"Name One/Child", childOfObjectOne);
758 Names::Add(
"Name Two/Child", childOfObjectTwo);
763 "Could not find a previously named Object via object context");
768 "Could not find a previously named Object via object context");
773 "Could not find a previously named child Object via object context");
778 "Could not find a previously named child Object via object context");
798 void DoRun()
override;
803 :
TestCase(
"Check string context-based Names::Find functionality")
829 Names::Add(
"Name One/Child", childOfObjectOne);
832 Names::Add(
"Name Two/Child", childOfObjectTwo);
837 "Could not find a previously named Object via string context");
842 "Could not find a previously named Object via stribng context");
847 "Could not find a previously named child Object via string context");
852 "Could not find a previously named child Object via string context");
872 void DoRun()
override;
877 :
TestCase(
"Check fully qualified path Names::Find functionality")
903 Names::Add(
"/Names/Name One/Child", childOfObjectOne);
906 Names::Add(
"/Names/Name Two/Child", childOfObjectTwo);
911 "Could not find a previously named Object via string context");
916 "Could not find a previously named Object via stribng context");
921 "Could not find a previously named child Object via string context");
926 "Could not find a previously named child Object via string context");
946 void DoRun()
override;
951 :
TestCase(
"Check relative path Names::Find functionality")
977 Names::Add(
"Name One/Child", childOfObjectOne);
980 Names::Add(
"Name Two/Child", childOfObjectTwo);
985 "Could not find a previously named Object via string context");
990 "Could not find a previously named Object via stribng context");
995 "Could not find a previously named child Object via string context");
1000 "Could not find a previously named child Object via string context");
1017 void DoRun()
override;
1022 :
TestCase(
"Check GetObject operation in Names::Find")
1043 Names::Add(
"Alternate Test Object", alternateTestObject);
1051 "Could not find a previously named TestObject via GetObject");
1055 alternateTestObject,
1056 "Could not find a previously named AlternateTestObject via GetObject");
1061 "Unexpectedly able to GetObject<AlternateTestObject> on a TestObject");
1066 "Unexpectedly able to GetObject<TestObject> on an AlternateTestObject");
static void Rename(std::string oldpath, std::string newname)
Rename a previously associated name.
static void Add(std::string name, Ptr< Object > object)
Add the association between the string "name" and the Ptr<Object> obj.
static Ptr< T > Find(std::string path)
Given a name path string, look to see if there's an object in the system with that associated to it.
static void Clear()
Clear the list of objects associated with names.
static std::string FindName(Ptr< Object > object)
Given a pointer to an object, look to see if that object has a name associated with it and,...
static std::string FindPath(Ptr< Object > object)
Given a pointer to an object, look to see if that object has a name associated with it and return the...
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Test the Object Name Service can find Objects using a second type.
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
~AlternateFindTestCase() override
Destructor.
AlternateFindTestCase()
Constructor.
Alternate test object for the Name service.
static TypeId GetTypeId()
Register this type.
AlternateTestObject()
Constructor.
Test the Object Name Service can do its most basic job.
~BasicAddTestCase() override
Destructor.
void DoRun() override
Implementation to actually run this TestCase.
BasicAddTestCase()
Constructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
Test the Object Name Service can find Objects.
~BasicFindTestCase() override
Destructor.
BasicFindTestCase()
Constructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
Test the Object Name Service can rename objects.
void DoRun() override
Implementation to actually run this TestCase.
BasicRenameTestCase()
Constructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
~BasicRenameTestCase() override
Destructor.
Test the Object Name Service can look up an object and return its fully qualified path name.
FindPathTestCase()
Constructor.
~FindPathTestCase() override
Destructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
Test the Object Name Service can correctly use a fully qualified path to add associations.
FullyQualifiedAddTestCase()
Constructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
~FullyQualifiedAddTestCase() override
Destructor.
void DoRun() override
Implementation to actually run this TestCase.
Test the Object Name Service can find Objects using a fully qualified path name.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
FullyQualifiedFindTestCase()
Constructor.
~FullyQualifiedFindTestCase() override
Destructor.
Test the Object Name Service can rename objects using a fully qualified path name.
~FullyQualifiedRenameTestCase() override
Destructor.
void DoRun() override
Implementation to actually run this TestCase.
FullyQualifiedRenameTestCase()
Constructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
NamesTestSuite()
Constructor.
Test the Object Name Service can correctly use a relative path to add associations.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
RelativeAddTestCase()
Constructor.
~RelativeAddTestCase() override
Destructor.
void DoRun() override
Implementation to actually run this TestCase.
Test the Object Name Service can find Objects using a relative path name.
RelativeFindTestCase()
Constructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
~RelativeFindTestCase() override
Destructor.
void DoRun() override
Implementation to actually run this TestCase.
Test the Object Name Service can rename objects using a relative path name.
~RelativeRenameTestCase() override
Destructor.
void DoRun() override
Implementation to actually run this TestCase.
RelativeRenameTestCase()
Constructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
Test the Object Name Service can correctly use a string context.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
~StringContextAddTestCase() override
Destructor.
StringContextAddTestCase()
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
Test the Object Name Service can find Objects using a string context.
~StringContextFindTestCase() override
Destructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
StringContextFindTestCase()
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
Test the Object Name Service can rename objects using a string context.
StringContextRenameTestCase()
Constructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
~StringContextRenameTestCase() override
Destructor.
Simple test object to exercise the Name service.
static TypeId GetTypeId()
Register this type.
static NamesTestSuite g_namesTestSuite
NamesTestSuite instance variable.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.