12#include "ns3/object.h"
14#include "ns3/string.h"
17#include "ns3/uinteger.h"
59 using Tuple2 = std::tuple<double, uint16_t, std::string>;
96 "StringStringEnumTuple",
97 "Tuple1: string, string, enum",
105 "DoubleUintStringTuple",
106 "Tuple2: double, uint16_t, string",
160 void DoRun()
override;
164 :
TestCase(
"test TupleValue attribute value")
177 "First element of tuple 1 not correctly set");
180 "Second element of tuple 1 not correctly set");
183 "Third element of tuple 1 not correctly set");
191 "Third element of tuple 2 not correctly set");
195 "StringStringEnumTuple",
207 "First element of tuple 1 not correctly set");
210 "Second element of tuple 1 not correctly set");
213 "Third element of tuple 1 not correctly set");
217 "DoubleUintStringTuple",
230 "Third element of tuple 2 not correctly set");
240 "First element of tuple 1 not correctly set");
243 "Second element of tuple 1 not correctly set");
246 "Third element of tuple 1 not correctly set");
258 "Third element of tuple 2 not correctly set");
267 "Tuple modified after failed assignment");
270 "StringStringEnumTuple",
277 "Tuple modified after failed assignment");
280 "DoubleUintStringTuple",
282 {4.83, 14,
"Josephson",
"constant"}));
286 "Tuple modified after failed assignment");
289 "DoubleUintStringTuple",
294 "Tuple modified after failed assignment");
297 "DoubleUintStringTuple",
302 "Tuple modified after failed assignment");
Object with attribute values storing tuples.
Tuple1 GetTuple1() const
Get tuple1.
void SetTuple1(const Tuple1 &tuple)
Set tuple1.
Tuple1Value::value_type Tuple1Pack
tuple of attribute values
Tuple2 m_tuple2
second tuple
std::tuple< double, uint16_t, std::string > Tuple2
Tuple2 typedef.
static TypeId GetTypeId()
Get the type ID.
Tuple2 GetTuple2() const
Get tuple2.
Tuple1 m_tuple1
first tuple
TupleTestEnum
Test enum type.
void SetTuple2(const Tuple2 &tuple)
Set tuple2.
Tuple1Value::result_type Tuple1
tuple of values
Test instantiation, initialization, access.
~TupleValueTestCase() override
void DoRun() override
Implementation to actually run this TestCase.
A base class which provides memory management and object aggregation.
Hold variables of type string.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
AttributeValue implementation for Tuple.
std::tuple< Args... > value_type
Type of value stored in the TupleValue.
std::tuple< std::invoke_result_t< decltype(&Args::Get), Args >... > result_type
Type returned by Get or passed in Set.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#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 > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Ptr< const AttributeChecker > MakeStringChecker()
static TupleValueTestSuite g_tupleValueTestSuite
Static variable for test initialization.