10#include <ns3/integer.h>
12#include <ns3/object.h>
15#include <ns3/string.h>
17#include <ns3/type-id.h>
81 "Pair: string, string",
85 .AddAttribute(
"DoubleIntPair",
125 void DoRun()
override;
129 :
TestCase(
"test instantiation, initialization, access")
137 std::pair<const int, double> ref = {1, 2.4};
141 std::pair<const int, double> rv = ac.
Get();
146 std::pair<const std::string, double> ref = {
"hello", 3.14};
150 std::pair<const std::string, double> rv = ac.
Get();
165 void DoRun()
override;
169 :
TestCase(
"test setting through attribute interface")
177 p->SetAttribute(
"StringPair",
179 p->SetAttribute(
"DoubleIntPair",
182 std::ostringstream oss;
185 std::ostringstream ref;
186 ref <<
"StringPair = { (hello,world) } DoubleIntPair = { (3.14,31) }";
Object holding pairs of values.
static TypeId GetTypeId()
Get the type ID.
std::pair< double, int > m_doubleIntPair
A pair of double, int.
std::pair< std::string, std::string > m_stringPair
A string pair.
friend std::ostream & operator<<(std::ostream &os, const PairObject &obj)
Stream insertion operator.
Pair test - test setting through attribute interface.
PairValueSettingsTestCase()
void DoRun() override
Implementation to actually run this TestCase.
Pair test - Test instantiation, initialization, access.
~PairValueTestCase() override
void DoRun() override
Implementation to actually run this TestCase.
The pair-value Test Suite.
A base class which provides memory management and object aggregation.
AttributeValue implementation for Pair.
result_type Get() const
Get the stored value as a std::pair.
void Set(const result_type &value)
Set the value.
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.
Ptr< const AttributeAccessor > MakePairAccessor(T1 a1)
Create an AttributeAccessor for std::pair<>.
Ptr< AttributeChecker > MakePairChecker()
Make a PairChecker without abscissa and ordinate AttributeCheckers.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
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.
Ptr< const AttributeChecker > MakeIntegerChecker()
Ptr< const AttributeChecker > MakeDoubleChecker()
std::ostream & operator<<(std::ostream &os, const Angles &a)
Ptr< const AttributeChecker > MakeStringChecker()
static PairValueTestSuite g_pairValueTestSuite
Static variable for test initialization.