A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
names-test-suite.cc
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: GPL-2.0-only
3 */
4
5#include "ns3/names.h"
6#include "ns3/test.h"
7
8/**
9 * \file
10 * \ingroup core-tests
11 * \ingroup config
12 * \ingroup names-tests
13 * Object Names test suite.
14 */
15
16/**
17 * \ingroup core-tests
18 * \defgroup names-tests Object Names test suite
19 */
20
21namespace ns3
22{
23
24namespace tests
25{
26
27/**
28 * \ingroup names-tests
29 * Simple test object to exercise the Name service.
30 */
31class TestObject : public Object
32{
33 public:
34 /**
35 * Register this type.
36 * \return The TypeId.
37 */
39 {
40 static TypeId tid = TypeId("TestObject")
42 .SetGroupName("Core")
43 .HideFromDocumentation()
44 .AddConstructor<TestObject>();
45 return tid;
46 }
47
48 /** Constructor. */
50 {
51 }
52};
53
54/**
55 * \ingroup names-tests
56 * Alternate test object for the Name service.
57 */
59{
60 public:
61 /**
62 * Register this type.
63 * \return The TypeId.
64 */
66 {
67 static TypeId tid = TypeId("AlternateTestObject")
69 .SetGroupName("Core")
70 .HideFromDocumentation()
71 .AddConstructor<AlternateTestObject>();
72 return tid;
73 }
74
75 /** Constructor. */
79};
80
81/**
82 * \ingroup names-tests
83 * Test the Object Name Service can do its most basic job.
84 *
85 * Add associations between Objects using the lowest level add
86 * function, which is:
87 *
88 * Add (Ptr<Object> context, std::string name, Ptr<Object> object);
89 *
90 * All other add functions will just translate into this form, so this is the
91 * most basic Add functionality.
92 */
94{
95 public:
96 /** Constructor. */
98 /** Destructor. */
99 ~BasicAddTestCase() override;
100
101 private:
102 void DoRun() override;
103 void DoTeardown() override;
104};
105
107 : TestCase("Check low level Names::Add and Names::FindName functionality")
108{
109}
110
114
115void
120
121void
123{
124 std::string found;
125
127 Names::Add(Ptr<Object>(nullptr, false), "Name One", objectOne);
128
130 Names::Add(Ptr<Object>(nullptr, false), "Name Two", objectTwo);
131
132 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
133 Names::Add(objectOne, "Child", childOfObjectOne);
134
135 Ptr<TestObject> childOfObjectTwo = CreateObject<TestObject>();
136 Names::Add(objectTwo, "Child", childOfObjectTwo);
137
138 found = Names::FindName(objectOne);
139 NS_TEST_ASSERT_MSG_EQ(found, "Name One", "Could not Names::Add and Names::FindName an Object");
140
141 found = Names::FindName(objectTwo);
143 "Name Two",
144 "Could not Names::Add and Names::FindName a second Object");
145
146 found = Names::FindName(childOfObjectOne);
148 "Child",
149 "Could not Names::Add and Names::FindName a child Object");
150
151 found = Names::FindName(childOfObjectTwo);
153 "Child",
154 "Could not Names::Add and Names::FindName a child Object");
155}
156
157/**
158 * \ingroup names-tests
159 * Test the Object Name Service can correctly use a string context.
160 *
161 * Add (std::string context, std::string name, Ptr<Object> object);
162 *
163 * High level path-based functions will translate into this form, so this is
164 * the second most basic Add functionality.
165 */
167{
168 public:
169 /** Constructor. */
171 /** Destructor. */
172 ~StringContextAddTestCase() override;
173
174 private:
175 void DoRun() override;
176 void DoTeardown() override;
177};
178
180 : TestCase("Check string context Names::Add and Names::FindName functionality")
181
182{
183}
184
188
189void
194
195void
197{
198 std::string found;
199
201 Names::Add("/Names", "Name One", objectOne);
202
204 Names::Add("/Names", "Name Two", objectTwo);
205
206 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
207 Names::Add("/Names/Name One", "Child", childOfObjectOne);
208
209 Ptr<TestObject> childOfObjectTwo = CreateObject<TestObject>();
210 Names::Add("/Names/Name Two", "Child", childOfObjectTwo);
211
212 found = Names::FindName(objectOne);
213 NS_TEST_ASSERT_MSG_EQ(found, "Name One", "Could not Names::Add and Names::FindName an Object");
214
215 found = Names::FindName(objectTwo);
217 "Name Two",
218 "Could not Names::Add and Names::FindName a second Object");
219
220 found = Names::FindName(childOfObjectOne);
222 "Child",
223 "Could not Names::Add and Names::FindName a child Object");
224
225 found = Names::FindName(childOfObjectTwo);
227 "Child",
228 "Could not Names::Add and Names::FindName a child Object");
229}
230
231/**
232 * \ingroup names-tests
233 * Test the Object Name Service can correctly use a
234 * fully qualified path to add associations.
235 *
236 * Add (std::string name, Ptr<Object> object);
237 *
238 */
240{
241 public:
242 /** Constructor. */
244 /** Destructor. */
246
247 private:
248 void DoRun() override;
249 void DoTeardown() override;
250};
251
253 : TestCase("Check fully qualified path Names::Add and Names::FindName functionality")
254
255{
256}
257
261
262void
267
268void
270{
271 std::string found;
272
274 Names::Add("/Names/Name One", objectOne);
275
277 Names::Add("/Names/Name Two", objectTwo);
278
279 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
280 Names::Add("/Names/Name One/Child", childOfObjectOne);
281
282 Ptr<TestObject> childOfObjectTwo = CreateObject<TestObject>();
283 Names::Add("/Names/Name Two/Child", childOfObjectTwo);
284
285 found = Names::FindName(objectOne);
286 NS_TEST_ASSERT_MSG_EQ(found, "Name One", "Could not Names::Add and Names::FindName an Object");
287
288 found = Names::FindName(objectTwo);
290 "Name Two",
291 "Could not Names::Add and Names::FindName a second Object");
292
293 found = Names::FindName(childOfObjectOne);
295 "Child",
296 "Could not Names::Add and Names::FindName a child Object");
297
298 found = Names::FindName(childOfObjectTwo);
300 "Child",
301 "Could not Names::Add and Names::FindName a child Object");
302}
303
304/**
305 * \ingroup names-tests
306 * Test the Object Name Service can correctly use a
307 * relative path to add associations.
308 *
309 * This functionality is provided as a convenience so clients
310 * don't always have to provide the name service namespace name
311 * in all of their strings.
312 *
313 * Add (std::string name, Ptr<Object> object);
314 *
315 */
317{
318 public:
319 /** Constructor. */
321 /** Destructor. */
322 ~RelativeAddTestCase() override;
323
324 private:
325 void DoRun() override;
326 void DoTeardown() override;
327};
328
330 : TestCase("Check relative path Names::Add and Names::FindName functionality")
331
332{
333}
334
338
339void
344
345void
347{
348 std::string found;
349
351 Names::Add("Name One", objectOne);
352
354 Names::Add("Name Two", objectTwo);
355
356 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
357 Names::Add("Name One/Child", childOfObjectOne);
358
359 Ptr<TestObject> childOfObjectTwo = CreateObject<TestObject>();
360 Names::Add("Name Two/Child", childOfObjectTwo);
361
362 found = Names::FindName(objectOne);
363 NS_TEST_ASSERT_MSG_EQ(found, "Name One", "Could not Names::Add and Names::FindName an Object");
364
365 found = Names::FindName(objectTwo);
367 "Name Two",
368 "Could not Names::Add and Names::FindName a second Object");
369
370 found = Names::FindName(childOfObjectOne);
372 "Child",
373 "Could not Names::Add and Names::FindName a child Object");
374
375 found = Names::FindName(childOfObjectTwo);
377 "Child",
378 "Could not Names::Add and Names::FindName a child Object");
379}
380
381/**
382 * \ingroup names-tests
383 * Test the Object Name Service can rename objects.
384 *
385 * Rename (Ptr<Object> context, std::string oldname, std::string newname);
386 *
387 * All other rename functions will just translate into this form, so this is the
388 * most basic rename functionality.
389 */
391{
392 public:
393 /** Constructor. */
395 /** Destructor. */
396 ~BasicRenameTestCase() override;
397
398 private:
399 void DoRun() override;
400 void DoTeardown() override;
401};
402
404 : TestCase("Check low level Names::Rename functionality")
405{
406}
407
411
412void
417
418void
420{
421 std::string found;
422
424 Names::Add(Ptr<Object>(nullptr, false), "Name", objectOne);
425
426 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
427 Names::Add(objectOne, "Child", childOfObjectOne);
428
429 found = Names::FindName(objectOne);
430 NS_TEST_ASSERT_MSG_EQ(found, "Name", "Could not Names::Add and Names::FindName an Object");
431
432 Names::Rename(Ptr<Object>(nullptr, false), "Name", "New Name");
433
434 found = Names::FindName(objectOne);
435 NS_TEST_ASSERT_MSG_EQ(found, "New Name", "Could not Names::Rename an Object");
436
437 found = Names::FindName(childOfObjectOne);
439 "Child",
440 "Could not Names::Add and Names::FindName a child Object");
441
442 Names::Rename(objectOne, "Child", "New Child");
443
444 found = Names::FindName(childOfObjectOne);
445 NS_TEST_ASSERT_MSG_EQ(found, "New Child", "Could not Names::Rename a child Object");
446}
447
448/**
449 * \ingroup names-tests
450 * Test the Object Name Service can rename objects
451 * using a string context.
452 *
453 * Rename (std::string context, std::string oldname, std::string newname);
454 *
455 */
457{
458 public:
459 /** Constructor. */
461 /** Destructor. */
463
464 private:
465 void DoRun() override;
466 void DoTeardown() override;
467};
468
470 : TestCase("Check string context-based Names::Rename functionality")
471{
472}
473
477
478void
483
484void
486{
487 std::string found;
488
490 Names::Add("/Names", "Name", objectOne);
491
492 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
493 Names::Add("/Names/Name", "Child", childOfObjectOne);
494
495 found = Names::FindName(objectOne);
496 NS_TEST_ASSERT_MSG_EQ(found, "Name", "Could not Names::Add and Names::FindName an Object");
497
498 Names::Rename("/Names", "Name", "New Name");
499
500 found = Names::FindName(objectOne);
501 NS_TEST_ASSERT_MSG_EQ(found, "New Name", "Could not Names::Rename an Object");
502
503 found = Names::FindName(childOfObjectOne);
505 "Child",
506 "Could not Names::Add and Names::FindName a child Object");
507
508 Names::Rename("/Names/New Name", "Child", "New Child");
509
510 found = Names::FindName(childOfObjectOne);
511 NS_TEST_ASSERT_MSG_EQ(found, "New Child", "Could not Names::Rename a child Object");
512}
513
514/**
515 * \ingroup names-tests
516 * Test the Object Name Service can rename objects
517 * using a fully qualified path name.
518 *
519 * Rename (std::string oldpath, std::string newname);
520 *
521 */
523{
524 public:
525 /** Constructor. */
527 /** Destructor. */
529
530 private:
531 void DoRun() override;
532 void DoTeardown() override;
533};
534
536 : TestCase("Check fully qualified path Names::Rename functionality")
537{
538}
539
543
544void
549
550void
552{
553 std::string found;
554
556 Names::Add("/Names/Name", objectOne);
557
558 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
559 Names::Add("/Names/Name/Child", childOfObjectOne);
560
561 found = Names::FindName(objectOne);
562 NS_TEST_ASSERT_MSG_EQ(found, "Name", "Could not Names::Add and Names::FindName an Object");
563
564 Names::Rename("/Names/Name", "New Name");
565
566 found = Names::FindName(objectOne);
567 NS_TEST_ASSERT_MSG_EQ(found, "New Name", "Could not Names::Rename an Object");
568
569 found = Names::FindName(childOfObjectOne);
571 "Child",
572 "Could not Names::Add and Names::FindName a child Object");
573
574 Names::Rename("/Names/New Name/Child", "New Child");
575
576 found = Names::FindName(childOfObjectOne);
577 NS_TEST_ASSERT_MSG_EQ(found, "New Child", "Could not Names::Rename a child Object");
578}
579
580/**
581 * \ingroup names-tests
582 * Test the Object Name Service can rename objects
583 * using a relative path name.
584 *
585 * Rename (std::string oldpath, std::string newname);
586 *
587 */
589{
590 public:
591 /** Constructor. */
593 /** Destructor. */
594 ~RelativeRenameTestCase() override;
595
596 private:
597 void DoRun() override;
598 void DoTeardown() override;
599};
600
602 : TestCase("Check relative path Names::Rename functionality")
603{
604}
605
609
610void
615
616void
618{
619 std::string found;
620
622 Names::Add("Name", objectOne);
623
624 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
625 Names::Add("Name/Child", childOfObjectOne);
626
627 found = Names::FindName(objectOne);
628 NS_TEST_ASSERT_MSG_EQ(found, "Name", "Could not Names::Add and Names::FindName an Object");
629
630 Names::Rename("Name", "New Name");
631
632 found = Names::FindName(objectOne);
633 NS_TEST_ASSERT_MSG_EQ(found, "New Name", "Could not Names::Rename an Object");
634
635 found = Names::FindName(childOfObjectOne);
637 "Child",
638 "Could not Names::Add and Names::FindName a child Object");
639
640 Names::Rename("New Name/Child", "New Child");
641
642 found = Names::FindName(childOfObjectOne);
643 NS_TEST_ASSERT_MSG_EQ(found, "New Child", "Could not Names::Rename a child Object");
644}
645
646/**
647 * \ingroup names-tests
648 * Test the Object Name Service can look up an object
649 * and return its fully qualified path name.
650 *
651 * FindPath (Ptr<Object> object);
652 *
653 */
655{
656 public:
657 /** Constructor. */
659 /** Destructor. */
660 ~FindPathTestCase() override;
661
662 private:
663 void DoRun() override;
664 void DoTeardown() override;
665};
666
668 : TestCase("Check Names::FindPath functionality")
669{
670}
671
675
676void
681
682void
684{
685 std::string found;
686
688 Names::Add("Name", objectOne);
689
690 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
691 Names::Add("/Names/Name/Child", childOfObjectOne);
692
693 found = Names::FindPath(objectOne);
695 "/Names/Name",
696 "Could not Names::Add and Names::FindPath an Object");
697
698 found = Names::FindPath(childOfObjectOne);
700 "/Names/Name/Child",
701 "Could not Names::Add and Names::FindPath a child Object");
702
703 Ptr<TestObject> objectNotThere = CreateObject<TestObject>();
704 found = Names::FindPath(objectNotThere);
705 NS_TEST_ASSERT_MSG_EQ(found.empty(), true, "Unexpectedly found a non-existent Object");
706}
707
708/**
709 * \ingroup names-tests
710 * Test the Object Name Service can find Objects.
711 *
712 * Find (Ptr<Object> context, std::string name);
713 *
714 */
716{
717 public:
718 /** Constructor. */
720 /** Destructor. */
721 ~BasicFindTestCase() override;
722
723 private:
724 void DoRun() override;
725 void DoTeardown() override;
726};
727
729 : TestCase("Check low level Names::Find functionality")
730{
731}
732
736
737void
742
743void
745{
746 Ptr<TestObject> found;
747
749 Names::Add("Name One", objectOne);
750
752 Names::Add("Name Two", objectTwo);
753
754 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
755 Names::Add("Name One/Child", childOfObjectOne);
756
757 Ptr<TestObject> childOfObjectTwo = CreateObject<TestObject>();
758 Names::Add("Name Two/Child", childOfObjectTwo);
759
760 found = Names::Find<TestObject>(Ptr<Object>(nullptr, false), "Name One");
762 objectOne,
763 "Could not find a previously named Object via object context");
764
765 found = Names::Find<TestObject>(Ptr<Object>(nullptr, false), "Name Two");
767 objectTwo,
768 "Could not find a previously named Object via object context");
769
770 found = Names::Find<TestObject>(objectOne, "Child");
772 childOfObjectOne,
773 "Could not find a previously named child Object via object context");
774
775 found = Names::Find<TestObject>(objectTwo, "Child");
777 childOfObjectTwo,
778 "Could not find a previously named child Object via object context");
779}
780
781/**
782 * \ingroup names-tests
783 * Test the Object Name Service can find Objects using
784 * a string context.
785 *
786 * Find (std::string context, std::string name);
787 *
788 */
790{
791 public:
792 /** Constructor. */
794 /** Destructor. */
796
797 private:
798 void DoRun() override;
799 void DoTeardown() override;
800};
801
803 : TestCase("Check string context-based Names::Find functionality")
804{
805}
806
810
811void
816
817void
819{
820 Ptr<TestObject> found;
821
823 Names::Add("Name One", objectOne);
824
826 Names::Add("Name Two", objectTwo);
827
828 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
829 Names::Add("Name One/Child", childOfObjectOne);
830
831 Ptr<TestObject> childOfObjectTwo = CreateObject<TestObject>();
832 Names::Add("Name Two/Child", childOfObjectTwo);
833
834 found = Names::Find<TestObject>("/Names", "Name One");
836 objectOne,
837 "Could not find a previously named Object via string context");
838
839 found = Names::Find<TestObject>("/Names", "Name Two");
841 objectTwo,
842 "Could not find a previously named Object via stribng context");
843
844 found = Names::Find<TestObject>("/Names/Name One", "Child");
846 childOfObjectOne,
847 "Could not find a previously named child Object via string context");
848
849 found = Names::Find<TestObject>("/Names/Name Two", "Child");
851 childOfObjectTwo,
852 "Could not find a previously named child Object via string context");
853}
854
855/**
856 * \ingroup names-tests
857 * Test the Object Name Service can find Objects using
858 * a fully qualified path name.
859 *
860 * Find (std::string name);
861 *
862 */
864{
865 public:
866 /** Constructor. */
868 /** Destructor. */
870
871 private:
872 void DoRun() override;
873 void DoTeardown() override;
874};
875
877 : TestCase("Check fully qualified path Names::Find functionality")
878{
879}
880
884
885void
890
891void
893{
894 Ptr<TestObject> found;
895
897 Names::Add("/Names/Name One", objectOne);
898
900 Names::Add("/Names/Name Two", objectTwo);
901
902 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
903 Names::Add("/Names/Name One/Child", childOfObjectOne);
904
905 Ptr<TestObject> childOfObjectTwo = CreateObject<TestObject>();
906 Names::Add("/Names/Name Two/Child", childOfObjectTwo);
907
908 found = Names::Find<TestObject>("/Names/Name One");
910 objectOne,
911 "Could not find a previously named Object via string context");
912
913 found = Names::Find<TestObject>("/Names/Name Two");
915 objectTwo,
916 "Could not find a previously named Object via stribng context");
917
918 found = Names::Find<TestObject>("/Names/Name One/Child");
920 childOfObjectOne,
921 "Could not find a previously named child Object via string context");
922
923 found = Names::Find<TestObject>("/Names/Name Two/Child");
925 childOfObjectTwo,
926 "Could not find a previously named child Object via string context");
927}
928
929/**
930 * \ingroup names-tests
931 * Test the Object Name Service can find Objects using
932 * a relative path name.
933 *
934 * Find (std::string name);
935 *
936 */
938{
939 public:
940 /** Constructor. */
942 /** Destructor. */
943 ~RelativeFindTestCase() override;
944
945 private:
946 void DoRun() override;
947 void DoTeardown() override;
948};
949
951 : TestCase("Check relative path Names::Find functionality")
952{
953}
954
958
959void
964
965void
967{
968 Ptr<TestObject> found;
969
971 Names::Add("Name One", objectOne);
972
974 Names::Add("Name Two", objectTwo);
975
976 Ptr<TestObject> childOfObjectOne = CreateObject<TestObject>();
977 Names::Add("Name One/Child", childOfObjectOne);
978
979 Ptr<TestObject> childOfObjectTwo = CreateObject<TestObject>();
980 Names::Add("Name Two/Child", childOfObjectTwo);
981
982 found = Names::Find<TestObject>("Name One");
984 objectOne,
985 "Could not find a previously named Object via string context");
986
987 found = Names::Find<TestObject>("Name Two");
989 objectTwo,
990 "Could not find a previously named Object via stribng context");
991
992 found = Names::Find<TestObject>("Name One/Child");
994 childOfObjectOne,
995 "Could not find a previously named child Object via string context");
996
997 found = Names::Find<TestObject>("Name Two/Child");
999 childOfObjectTwo,
1000 "Could not find a previously named child Object via string context");
1001}
1002
1003/**
1004 * \ingroup names-tests
1005 * Test the Object Name Service can find Objects using
1006 * a second type.
1007 */
1009{
1010 public:
1011 /** Constructor. */
1013 /** Destructor. */
1014 ~AlternateFindTestCase() override;
1015
1016 private:
1017 void DoRun() override;
1018 void DoTeardown() override;
1019};
1020
1022 : TestCase("Check GetObject operation in Names::Find")
1023{
1024}
1025
1029
1030void
1035
1036void
1038{
1040 Names::Add("Test Object", testObject);
1041
1043 Names::Add("Alternate Test Object", alternateTestObject);
1044
1045 Ptr<TestObject> foundTestObject;
1046 Ptr<AlternateTestObject> foundAlternateTestObject;
1047
1048 foundTestObject = Names::Find<TestObject>("Test Object");
1049 NS_TEST_ASSERT_MSG_EQ(foundTestObject,
1050 testObject,
1051 "Could not find a previously named TestObject via GetObject");
1052
1053 foundAlternateTestObject = Names::Find<AlternateTestObject>("Alternate Test Object");
1054 NS_TEST_ASSERT_MSG_EQ(foundAlternateTestObject,
1055 alternateTestObject,
1056 "Could not find a previously named AlternateTestObject via GetObject");
1057
1058 foundAlternateTestObject = Names::Find<AlternateTestObject>("Test Object");
1059 NS_TEST_ASSERT_MSG_EQ(foundAlternateTestObject,
1060 nullptr,
1061 "Unexpectedly able to GetObject<AlternateTestObject> on a TestObject");
1062
1063 foundTestObject = Names::Find<TestObject>("Alternate Test Object");
1064 NS_TEST_ASSERT_MSG_EQ(foundTestObject,
1065 nullptr,
1066 "Unexpectedly able to GetObject<TestObject> on an AlternateTestObject");
1067}
1068
1069/**
1070 * \ingroup names-tests
1071 * Names Test Suite
1072 */
1074{
1075 public:
1076 /** Constructor. */
1078};
1079
1098
1099/**
1100 * \ingroup names-tests
1101 * NamesTestSuite instance variable.
1102 */
1104
1105} // namespace tests
1106
1107} // namespace ns3
static void Rename(std::string oldpath, std::string newname)
Rename a previously associated name.
Definition names.cc:772
static void Add(std::string name, Ptr< Object > object)
Add the association between the string "name" and the Ptr<Object> obj.
Definition names.cc:764
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.
Definition names.h:443
static void Clear()
Clear the list of objects associated with names.
Definition names.cc:832
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,...
Definition names.cc:818
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...
Definition names.cc:825
A base class which provides memory management and object aggregation.
Definition object.h:78
Smart pointer class similar to boost::intrusive_ptr.
encapsulates test code
Definition test.h:1050
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:292
A suite of tests to run.
Definition test.h:1267
a unique identifier for an interface.
Definition type-id.h:48
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1001
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.
Alternate test object for the Name service.
static TypeId GetTypeId()
Register this type.
Test the Object Name Service can do its most basic job.
~BasicAddTestCase() override
Destructor.
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
Test the Object Name Service can find Objects.
~BasicFindTestCase() 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 rename objects.
void DoRun() override
Implementation to actually run this TestCase.
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() 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.
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() override
Destructor.
Test the Object Name Service can rename objects using a fully qualified path name.
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
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() override
Destructor.
void DoRun() override
Implementation to actually run this TestCase.
Test the Object Name Service can find Objects using a relative path name.
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.
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.
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.
void DoRun() override
Implementation to actually run this TestCase.
Test the Object Name Service can rename objects using a string context.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
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.
Definition object.h:619
#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.
Definition test.h:134
Every class exported by the ns3 library is enclosed in the ns3 namespace.