10#include "ns3/integer.h"
12#include "ns3/object.h"
15#include "ns3/string.h"
17#include "ns3/type-id.h"
79 "Pair: string, string",
83 .AddAttribute(
"DoubleIntPair",
123 void DoRun()
override;
127 :
TestCase(
"test instantiation, initialization, access")
135 std::pair<const int, double> ref = {1, 2.4};
139 std::pair<const int, double> rv = ac.
Get();
144 std::pair<const std::string, double> ref = {
"hello", 3.14};
148 std::pair<const std::string, double> rv = ac.
Get();
163 void DoRun()
override;
167 :
TestCase(
"test setting through attribute interface")
175 p->SetAttribute(
"StringPair",
177 p->SetAttribute(
"DoubleIntPair",
180 std::ostringstream oss;
183 std::ostringstream ref;
184 ref <<
"StringPair = { (hello,world) } DoubleIntPair = { (3.14,31) }";
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.
Object()
Caller graph was not generated because of its size.
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.
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeChecker > MakeIntegerChecker()
Ptr< const AttributeAccessor > MakePairAccessor(T1 a1)
Create an AttributeAccessor for std::pair<>.
Ptr< AttributeChecker > MakePairChecker(const PairValue< A, B > &value)
Make a PairChecker from a PairValue.
Ptr< const AttributeChecker > MakeStringChecker()
#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.
std::ostream & operator<<(std::ostream &os, const Angles &a)
static PairValueTestSuite g_pairValueTestSuite
Static variable for test initialization.