TracedCallback System Tests. More...
Files | |
file | traced-callback-typedef-test-suite.cc |
TracedCallback tests to verify if they are called with the right type and number of arguments. | |
file | traced-value-callback-typedef-test-suite.cc |
TracedValueCallback tests to verify that they work with different types of classes - it tests bool, double, various types of integers types, Time, and SequenceNumber32. | |
Classes | |
class | TracedCallbackTypedefTestCase |
TracedCallback Testcase. More... | |
class | TracedCallbackTypedefTestSuite |
TracedCallback typedef TestSuite. More... | |
class | anonymous_namespace{traced-callback-typedef-test-suite.cc}::TracedCbSink< Ts > |
Sink functions. More... | |
class | TracedValueCallbackTestCase |
TracedValueCallback Test Case. More... | |
class | TracedValueCallbackTestSuite |
TracedValueCallback TestSuite. More... | |
Macros | |
#define | CHECK(U, ...) CreateObject<Checker<__VA_ARGS__>>()->Invoke<U>() |
Check the TracedCallback by calling its Invoke function. More... | |
#define | DUPE(U, T1) |
Check the TracedCallback duplicate by checking if it matches the TracedCallback it is supposed to be equal to. More... | |
#define | TYPENAME(T) |
Returns a string representing the type of a class. More... | |
Variables | |
std::set< std::string > | anonymous_namespace{traced-callback-typedef-test-suite.cc}::g_dupes = Duplicates() |
Container for duplicate types. More... | |
std::string | anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::g_Result = "" |
Result of callback test. More... | |
TracedCallback System Tests.
#define CHECK | ( | U, | |
... | |||
) | CreateObject<Checker<__VA_ARGS__>>()->Invoke<U>() |
Check the TracedCallback by calling its Invoke function.
Definition at line 354 of file traced-callback-typedef-test-suite.cc.
#define DUPE | ( | U, | |
T1 | |||
) |
Check the TracedCallback duplicate by checking if it matches the TracedCallback it is supposed to be equal to.
Definition at line 331 of file traced-callback-typedef-test-suite.cc.
#define TYPENAME | ( | T | ) |
Returns a string representing the type of a class.
Definition at line 148 of file traced-callback-typedef-test-suite.cc.
std::set<std::string> anonymous_namespace{traced-callback-typedef-test-suite.cc}::Duplicates | ( | ) |
Record typedefs which are identical to previously declared.
Definition at line 107 of file traced-callback-typedef-test-suite.cc.
void anonymous_namespace{traced-callback-typedef-test-suite.cc}::SinkIt | ( | std::size_t | N | ) |
Log that a callback was invoked.
We can't actually do anything with any of the arguments, but the fact we got called is what's important.
[in] | N | The number of arguments passed to the callback. |
Definition at line 235 of file traced-callback-typedef-test-suite.cc.
References TracedCallbackTypedefTestCase::m_nArgs.
Referenced by anonymous_namespace{traced-callback-typedef-test-suite.cc}::TracedCbSink< Ts >::Sink().
void anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::TracedValueCbSink | ( | T | oldValue, |
T | newValue | ||
) |
Template for TracedValue sink functions.
This generates a sink function for any underlying type.
T | [explicit] The type of the value being traced. Since the point of this template is to create a sink function, the template type must be given explicitly. |
[in] | oldValue | The original value |
[in] | newValue | The new value |
Definition at line 72 of file traced-value-callback-typedef-test-suite.cc.
References anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::g_Result.
void anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::TracedValueCbSink< SequenceNumber32 > | ( | SequenceNumber32 | oldValue, |
SequenceNumber32 | newValue | ||
) |
TracedValueCbSink specialization for SequenceNumber32.
oldValue | The old value |
newValue | The new value |
Definition at line 110 of file traced-value-callback-typedef-test-suite.cc.
References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue().
void anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::TracedValueCbSink< Time > | ( | Time | oldValue, |
Time | newValue | ||
) |
TracedValueCbSink specialization for Time.
oldValue | The old value |
newValue | The new value |
Definition at line 96 of file traced-value-callback-typedef-test-suite.cc.
References ns3::Time::GetInteger().
|
inline |
Stringify the known TracedCallback type names.
T | [explicit] The typedef name. |
[in] | N | The number of arguments expected. |
TracedCallback
type name. Definition at line 138 of file traced-callback-typedef-test-suite.cc.
std::set<std::string> anonymous_namespace{traced-callback-typedef-test-suite.cc}::g_dupes = Duplicates() |
Container for duplicate types.
Definition at line 125 of file traced-callback-typedef-test-suite.cc.
std::string anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::g_Result = "" |
Result of callback test.
Since the sink function is outside the invoking class, which in this case is TracedValueCallbackTestCase, we can't use the test macros directly. Instead, we cache the result in the g_Result
global value, then inspect it in the TracedValueCallbackTestCase::CheckType method.
Definition at line 55 of file traced-value-callback-typedef-test-suite.cc.
Referenced by TracedValueCallbackTestCase::CheckType(), TracedValueCallbackTestCase::CheckTvCb< T >::Invoke(), and anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::TracedValueCbSink().