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. | |
#define | DUPE(U, T1) |
Check the TracedCallback duplicate by checking if it matches the TracedCallback it is supposed to be equal to. | |
#define | TYPENAME(T) |
Returns a string representing the type of a class. | |
Variables | |
std::set< std::string > | anonymous_namespace{traced-callback-typedef-test-suite.cc}::g_dupes = Duplicates() |
Container for duplicate types. | |
std::string | anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::g_Result = "" |
Result of callback test. | |
TracedCallback System Tests
#define CHECK | ( | U, | |
... ) CreateObject<Checker<__VA_ARGS__>>()->Invoke<U>() |
Check the TracedCallback by calling its Invoke function.
Definition at line 344 of file traced-callback-typedef-test-suite.cc.
Referenced by TracedCallbackTypedefTestCase::DoRun().
#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 321 of file traced-callback-typedef-test-suite.cc.
Referenced by TracedCallbackTypedefTestCase::DoRun().
#define TYPENAME | ( | T | ) |
Returns a string representing the type of a class.
Definition at line 138 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 97 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 225 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 61 of file traced-value-callback-typedef-test-suite.cc.
References anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::g_Result.
Referenced by TracedValueCallbackTestCase::CheckType(), anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::TracedValueCbSink< SequenceNumber32 >(), and anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::TracedValueCbSink< Time >().
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 99 of file traced-value-callback-typedef-test-suite.cc.
References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), and anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::TracedValueCbSink().
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 85 of file traced-value-callback-typedef-test-suite.cc.
References ns3::Time::GetInteger(), and anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::TracedValueCbSink().
|
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 128 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 115 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 44 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().