Utils::CalitkoMocks::Testing::BoundFunctionTest Class Reference

Inherits TestFixture.

Inheritance diagram for Utils::CalitkoMocks::Testing::BoundFunctionTest:

Inheritance graph
[legend]
Collaboration diagram for Utils::CalitkoMocks::Testing::BoundFunctionTest:

Collaboration graph
[legend]
List of all members.

Detailed Description

Tests for class BoundFunction.

We have performed the following tests:

Definition at line 75 of file BoundFunctionTest.cpp.

Public Member Functions

void VoidVoid ()
void testVoidVoid ()
 Test binding a void() function.
int IntVoid ()
void testIntVoid ()
 Test binding an int () function.
void testIntVoidReturnIncorrect ()
 Test that if return value doesn't match, an exception is thrown.
void testIntVoidReturnNotSet ()
 Test that if willReturn() is not called, an exception is thrown.
void testIntVoidReturnNotSetWithContext ()
 Test that if willReturn() is not called, an exception is thrown.
int IntInt (int a)
void testIntInt ()
 Test binding an int (int) function.
bool & BoolRefIntRefConstIntRef (int &a, const int &b)
void testBoolRefIntRefConstIntRef ()
 Test binding an int & (int &, const int &) function.
int IntIntWithExpectations (int)
void testIntIntWithExpectationsOk ()
 Verify that bound function with correctly checked expectations works.
void testIntIntWithExpectationsBadCheckFail ()
 Verify that bound function with incorrectly checked expectations fails.
void testIntIntWithExpectationsNotCheckedFail ()
 Verify that bound function with incorrectly checked expectations fails.
void VoidIntWithExpectations (int v)
void testVoidIntWithExpectationsNotCheckedFail ()
 Verify that bound function with incorrectly checked expectations fails.
void testVoidIntFailSetOwnContextIfNotSet ()
 Upon failure, set own context if not set by the thrower.

Public Attributes

bool VoidVoidOk
bool IntVoidOk
bool IntIntOk
bool BoolRefIntRefConstIntRefOk
auto_ptr< ExpectedFunction<
void(int)> > 
IntIntExpectation1
auto_ptr< ExpectedFunction<
void(int)> > 
IntIntExpectation2

Private Member Functions

 CPPUNIT_TEST_SUITE (BoundFunctionTest)
 CPPUNIT_TEST (testVoidVoid)
 CPPUNIT_TEST (testIntVoid)
 CPPUNIT_TEST (testIntVoidReturnIncorrect)
 CPPUNIT_TEST (testIntVoidReturnNotSet)
 CPPUNIT_TEST (testIntVoidReturnNotSetWithContext)
 CPPUNIT_TEST (testIntInt)
 CPPUNIT_TEST (testBoolRefIntRefConstIntRef)
 CPPUNIT_TEST (testIntIntWithExpectationsOk)
 CPPUNIT_TEST (testIntIntWithExpectationsBadCheckFail)
 CPPUNIT_TEST (testIntIntWithExpectationsNotCheckedFail)
 CPPUNIT_TEST (testVoidIntWithExpectationsNotCheckedFail)
 CPPUNIT_TEST (testVoidIntFailSetOwnContextIfNotSet)
 CPPUNIT_TEST_SUITE_END ()


Member Function Documentation

bool& Utils::CalitkoMocks::Testing::BoundFunctionTest::BoolRefIntRefConstIntRef int &  a,
const int &  b
[inline]
 

Definition at line 174 of file BoundFunctionTest.cpp.

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testVoidIntFailSetOwnContextIfNotSet   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testVoidIntWithExpectationsNotCheckedFail   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testIntIntWithExpectationsNotCheckedFail   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testIntIntWithExpectationsBadCheckFail   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testIntIntWithExpectationsOk   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testBoolRefIntRefConstIntRef   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testIntInt   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testIntVoidReturnNotSetWithContext   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testIntVoidReturnNotSet   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testIntVoidReturnIncorrect   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testIntVoid   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST testVoidVoid   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST_SUITE BoundFunctionTest   )  [private]
 

Utils::CalitkoMocks::Testing::BoundFunctionTest::CPPUNIT_TEST_SUITE_END  )  [private]
 

int Utils::CalitkoMocks::Testing::BoundFunctionTest::IntInt int  a  )  [inline]
 

Definition at line 164 of file BoundFunctionTest.cpp.

int Utils::CalitkoMocks::Testing::BoundFunctionTest::IntIntWithExpectations int   )  [inline]
 

Definition at line 190 of file BoundFunctionTest.cpp.

int Utils::CalitkoMocks::Testing::BoundFunctionTest::IntVoid  )  [inline]
 

Definition at line 104 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testBoolRefIntRefConstIntRef  )  [inline]
 

Test binding an int & (int &, const int &) function.

Definition at line 178 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testIntInt  )  [inline]
 

Test binding an int (int) function.

Definition at line 166 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testIntIntWithExpectationsBadCheckFail  )  [inline]
 

Verify that bound function with incorrectly checked expectations fails.

Definition at line 213 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testIntIntWithExpectationsNotCheckedFail  )  [inline]
 

Verify that bound function with incorrectly checked expectations fails.

Definition at line 236 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testIntIntWithExpectationsOk  )  [inline]
 

Verify that bound function with correctly checked expectations works.

Definition at line 198 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testIntVoid  )  [inline]
 

Test binding an int () function.

Definition at line 106 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testIntVoidReturnIncorrect  )  [inline]
 

Test that if return value doesn't match, an exception is thrown.

Definition at line 114 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testIntVoidReturnNotSet  )  [inline]
 

Test that if willReturn() is not called, an exception is thrown.

Definition at line 130 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testIntVoidReturnNotSetWithContext  )  [inline]
 

Test that if willReturn() is not called, an exception is thrown.

Definition at line 146 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testVoidIntFailSetOwnContextIfNotSet  )  [inline]
 

Upon failure, set own context if not set by the thrower.

An expectation or a nested bound function may fail and would thus throw an exception without a context being set. In such cases we should set retrow with the original message and our context set.

Definition at line 295 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testVoidIntWithExpectationsNotCheckedFail  )  [inline]
 

Verify that bound function with incorrectly checked expectations fails.

Definition at line 266 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::testVoidVoid  )  [inline]
 

Test binding a void() function.

Definition at line 96 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::VoidIntWithExpectations int  v  )  [inline]
 

Definition at line 260 of file BoundFunctionTest.cpp.

void Utils::CalitkoMocks::Testing::BoundFunctionTest::VoidVoid  )  [inline]
 

Definition at line 94 of file BoundFunctionTest.cpp.


Member Data Documentation

bool Utils::CalitkoMocks::Testing::BoundFunctionTest::BoolRefIntRefConstIntRefOk
 

Definition at line 173 of file BoundFunctionTest.cpp.

auto_ptr<ExpectedFunction <void (int)> > Utils::CalitkoMocks::Testing::BoundFunctionTest::IntIntExpectation1
 

Definition at line 187 of file BoundFunctionTest.cpp.

auto_ptr<ExpectedFunction <void (int)> > Utils::CalitkoMocks::Testing::BoundFunctionTest::IntIntExpectation2
 

Definition at line 188 of file BoundFunctionTest.cpp.

bool Utils::CalitkoMocks::Testing::BoundFunctionTest::IntIntOk
 

Definition at line 163 of file BoundFunctionTest.cpp.

bool Utils::CalitkoMocks::Testing::BoundFunctionTest::IntVoidOk
 

Definition at line 103 of file BoundFunctionTest.cpp.

bool Utils::CalitkoMocks::Testing::BoundFunctionTest::VoidVoidOk
 

Definition at line 93 of file BoundFunctionTest.cpp.


The documentation for this class was generated from the following file: