20 #include "ns3/callback.h"
35 int Target2 (
void) { m_test2 =
true;
return 2; }
36 void Target3 (
double a) { m_test3 =
true; }
37 int Target4 (
double a,
int b) { m_test4 =
true;
return 4; }
40 virtual void DoRun (
void);
41 virtual void DoSetup (
void);
73 :
TestCase (
"Check basic Callback mechansim")
170 virtual void DoRun (
void);
203 :
TestCase (
"Check MakeCallback() mechanism")
295 virtual void DoRun (
void);
394 :
TestCase (
"Check MakeBoundCallback() mechanism")
462 int result = target3 (2468);
476 int resultTwoA = target5 ();
482 int resultTwoB = target6 (6789);
498 int resultThreeA = target8 ();
505 int resultThreeB = target9 (5678);
525 virtual void DoRun (
void);
532 :
TestCase (
"Check Nullify() and IsNull()")
573 virtual void DoRun (
void);
591 void TestFRSix (
int &,
int &,
int &,
int &,
int &,
int &) {}
613 void TestSix (
int,
int,
int,
int,
int,
int) {}
620 void TestCSix (
int,
int,
int,
int,
int,
int)
const {}
636 :
TestCase (
"Check various MakeCallback() template functions")
void MakeBoundCallbackTarget2(bool *a)
static int gMakeBoundCallbackTest5a
static int gMakeBoundCallbackTest5b
void MakeBoundCallbackTarget4(int a, int b)
virtual ~MakeCallbackTestCase()
void TestCSix(int, int, int, int, int, int) const
void TestFThree(int, int, int)
void TestFRThree(int &, int &, int &)
static int gMakeBoundCallbackTest9c
static int gMakeBoundCallbackTest8a
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Build bound Callbacks which take varying numbers of arguments, and potentially returning a value...
bool IsNull(void) const
Check for null implementation.
NullifyCallbackTestCase()
void CheckParentalRights(void)
void TestFRFive(int &, int &, int &, int &, int &)
static int gMakeBoundCallbackTest8b
MakeCallbackTemplatesTestCase()
void TestCThree(int, int, int) const
static int gMakeBoundCallbackTest9b
int MakeBoundCallbackTarget8(int a, int b, int c)
virtual void DoRun(void)
Implementation to actually run this TestCase.
static bool * gMakeBoundCallbackTest2
void TestFFive(int, int, int, int, int)
virtual void DoRun(void)
Implementation to actually run this TestCase.
int MakeBoundCallbackTarget5(int a, int b)
static int gMakeBoundCallbackTest1
static int gMakeBoundCallbackTest6a
static bool gBasicCallbackTest5
virtual ~MakeCallbackTemplatesTestCase()
static int gMakeBoundCallbackTest8c
int Target4(double a, int b)
void TestSix(int, int, int, int, int, int)
static int gMakeBoundCallbackTest5c
static int gMakeBoundCallbackTest9d
void MakeBoundCallbackTarget1(int a)
void TestFSix(int, int, int, int, int, int)
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
static int gMakeBoundCallbackTest4a
void MakeCallbackTarget6(int)
int MakeBoundCallbackTarget6(int a, int b, int c)
virtual void DoSetup(void)
Implementation to do any local setup required for this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
static CallbackTestSuite CallbackTestSuite
static bool gBasicCallbackTest6
void BasicCallbackTarget6(int)
void MakeBoundCallbackTarget7(int a, int b, int c)
void TestCTwo(int, int) const
virtual void DoSetup(void)
Implementation to do any local setup required for this TestCase.
void TestCFour(int, int, int, int) const
static int gMakeBoundCallbackTest7a
static bool gBasicCallbackTest7
virtual ~BasicCallbackTestCase()
int BasicCallbackTarget7(int a)
void TestFive(int, int, int, int, int)
static int gMakeBoundCallbackTest7c
virtual ~NullifyCallbackTestCase()
static bool gMakeCallbackTest5
static int gMakeBoundCallbackTest9a
void TestCFive(int, int, int, int, int) const
static void StaticProtectedParent(void)
int MakeCallbackTarget7(int a)
void TestFRSix(int &, int &, int &, int &, int &, int &)
void BasicCallbackTarget5(void)
int MakeBoundCallbackTarget9(int a, int b, int c, int d)
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
void TestFRFour(int &, int &, int &, int &)
void TestCZero(void) const
void TestFour(int, int, int, int)
virtual ~MakeBoundCallbackTestCase()
static int gMakeBoundCallbackTest7b
MakeBoundCallbackTestCase()
void TestFRTwo(int &, int &)
static int gMakeBoundCallbackTest6b
void TestFFour(int, int, int, int)
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoSetup(void)
Implementation to do any local setup required for this TestCase.
void ProtectedParent(void)
void Nullify(void)
Discard the implementation, set it to null.
static bool gMakeCallbackTest6
static int gMakeBoundCallbackTest6c
virtual void DoSetup(void)
Implementation to do any local setup required for this TestCase.
static int gMakeBoundCallbackTest4b
virtual void DoRun(void)
Implementation to actually run this TestCase.
static bool gMakeCallbackTest7
int Target4(double a, int b)
static int gMakeBoundCallbackTest3b
void MakeCallbackTarget5(void)
int MakeBoundCallbackTarget3(bool *a, int b)
void TestThree(int, int, int)
#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.
static bool * gMakeBoundCallbackTest3a