[Mockpp-commits] mockpp/mockpp AbstractExpectation.h,1.22,1.23 ChainableMockObject.cpp,1.14,1.15 Cha
Brought to you by:
ewald-arnold
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24081/mockpp Modified Files: AbstractExpectation.h ChainableMockObject.cpp ChainableMockObject.h ExpectationBoundary.h ExpectationConglomeration.h ExpectationCounter.cpp ExpectationCounter.h ExpectationList.h ExpectationSegment.h ExpectationSet.h ExpectationValue.h Makefile.am MockObject.cpp MockObject.h ReturnObjectList.h ThrowableList.cpp ThrowableList.h TrackingCounter.cpp TrackingCounter.h Verifiable.cpp Verifiable.h VerifiableList.cpp VerifiableList.h VerifyingTestCase.cpp VerifyingTestCase.h VisitableMockObject.cpp VisitableMockObject.h VisitableMockObject_macro.h VisitableMockObject_template.h Log Message: - VisitableMockObjects optionally take Constraints - mock objects reset all their sub objects - all mock objects get their own reset() method - ReturnObjectList has a default return value - changed "verify() const" to "verify()" Index: TrackingCounter.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/TrackingCounter.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TrackingCounter.cpp 20 Feb 2005 00:16:51 -0000 1.5 --- TrackingCounter.cpp 27 Feb 2005 11:48:14 -0000 1.6 *************** *** 119,123 **** ! void MOCKPP_EXPORT TrackingCounterMaster::verify() const { for (unsigned i = 0; i < clients.size(); ++i) --- 119,123 ---- ! void MOCKPP_EXPORT TrackingCounterMaster::verify() { for (unsigned i = 0; i < clients.size(); ++i) *************** *** 176,179 **** --- 176,184 ---- + void MOCKPP_EXPORT TrackingCounterMaster::reset() + { + clearActual(); + } + void MOCKPP_EXPORT TrackingCounterMaster::clearActual() { *************** *** 207,211 **** master = &in_master; master->addClient(this); ! myActualValue = 0; } --- 212,216 ---- master = &in_master; master->addClient(this); ! clearActual(); } *************** *** 217,220 **** --- 222,230 ---- + void MOCKPP_EXPORT TrackingCounterClient::reset() + { + clearActual(); + } + void MOCKPP_EXPORT TrackingCounterClient::clearActual() { *************** *** 244,248 **** ! void MOCKPP_EXPORT TrackingCounterClient::verify() const { if (!this->hasExpectations() ) --- 254,258 ---- ! void MOCKPP_EXPORT TrackingCounterClient::verify() { if (!this->hasExpectations() ) Index: MockObject.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/MockObject.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** MockObject.cpp 30 Dec 2004 20:54:03 -0000 1.22 --- MockObject.cpp 27 Feb 2005 11:48:14 -0000 1.23 *************** *** 57,61 **** ! void MOCKPP_EXPORT MockObject::verify() const { verifyAnObject(this); --- 57,68 ---- ! void MOCKPP_EXPORT MockObject::reset() // @todo test ! { ! for (unsigned i = 0; i < numVerifiables(); ++i) ! getVerifiable(i)->reset(); ! } ! ! ! void MOCKPP_EXPORT MockObject::verify() { verifyAnObject(this); *************** *** 63,67 **** ! void MOCKPP_EXPORT MockObject::verifyAnObject(const VerifiableList* anObject) { VerifierVec myProcessingObjects; --- 70,74 ---- ! void MOCKPP_EXPORT MockObject::verifyAnObject(VerifiableList* anObject) { VerifierVec myProcessingObjects; *************** *** 71,75 **** ! void MOCKPP_EXPORT MockObject::verifySubFields(const Verifiable *anObject, VerifierVec &alreadyProcessed) { --- 78,82 ---- ! void MOCKPP_EXPORT MockObject::verifySubFields(Verifiable *anObject, VerifierVec &alreadyProcessed) { *************** *** 86,90 **** ! void MOCKPP_EXPORT MockObject::verifyField(const Verifiable *anObject, VerifierVec &alreadyProcessed) { --- 93,97 ---- ! void MOCKPP_EXPORT MockObject::verifyField(Verifiable *anObject, VerifierVec &alreadyProcessed) { Index: VisitableMockObject_macro.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject_macro.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** VisitableMockObject_macro.h 4 Jan 2005 19:58:24 -0000 1.24 --- VisitableMockObject_macro.h 27 Feb 2005 11:48:14 -0000 1.25 *************** *** 220,224 **** #define MOCKPP_CONTROLLER_IMPL_VERIFY(methname) \ ! virtual void verify() const \ { \ if (objptr->methname ## haveDefaultReturnValue) \ --- 220,224 ---- #define MOCKPP_CONTROLLER_IMPL_VERIFY(methname) \ ! virtual void verify() \ { \ [...1317 lines suppressed...] + mockpp::Constraint<v_type1>::AP cons1 (param1); \ + mockpp::Constraint<v_type2>::AP cons2 (param2); \ + mockpp::Constraint<v_type3>::AP cons3 (param3); \ + mockpp::Constraint<v_type4>::AP cons4 (param4); \ + mockpp::Constraint<v_type5>::AP cons5 (param5); \ + m_name ## Parameter1.addExpected(cons1.release()); \ + m_name ## Parameter2.addExpected(cons2.release()); \ + m_name ## Parameter3.addExpected(cons3.release()); \ + m_name ## Parameter4.addExpected(cons4.release()); \ + m_name ## Parameter5.addExpected(cons5.release()); \ + return v_ret_type(); \ + } \ MOCKPP_MEMBER_RESTRICTOR_PRIVATE: \ ! MOCKPP_DECLARE_DEFAULT_VARS(m_name); \ ! MOCKPP_DECLARE_RETURN_VARS(v_ret_type, m_name); \ ! mutable mockpp::ResponseVector5<v_ret_type, v_type1, v_type2, v_type3, v_type4, v_type5> m_name ## ResponseValues; \ ! MOCKPP_DECLARE_PARAMETER_VARS5(m_name, v_type1, v_type2, v_type3, v_type4, v_type5); \ ! MOCKPP_CONTROLLER_DECL5(classname, v_ret_type, m_name, v_type1, v_type2, v_type3, v_type4, v_type5) Index: ThrowableList.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ThrowableList.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ThrowableList.cpp 30 Dec 2004 20:54:03 -0000 1.18 --- ThrowableList.cpp 27 Feb 2005 11:48:14 -0000 1.19 *************** *** 113,117 **** ! void MOCKPP_EXPORT ThrowableList::verify() const { String fmt = i18n(MOCKPP_PCHAR("%1 has %2 un-used objects.")); --- 113,123 ---- ! void MOCKPP_EXPORT ThrowableList::reset() ! { ! clear(); ! } ! ! ! void MOCKPP_EXPORT ThrowableList::verify() { String fmt = i18n(MOCKPP_PCHAR("%1 has %2 un-used objects.")); Index: VisitableMockObject.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** VisitableMockObject.cpp 29 Jan 2005 13:54:47 -0000 1.20 --- VisitableMockObject.cpp 27 Feb 2005 11:48:14 -0000 1.21 *************** *** 71,75 **** ! void MOCKPP_EXPORT VisitableMockObject::verify() const { MockObject::verify(); --- 71,75 ---- ! void MOCKPP_EXPORT VisitableMockObject::verify() { MockObject::verify(); *************** *** 81,84 **** --- 81,85 ---- void MOCKPP_EXPORT VisitableMockObject::reset() { + MockObject::reset(); activated = false; for (unsigned i = 0; i < controllers.size(); ++i) Index: Verifiable.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/Verifiable.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Verifiable.h 30 Jan 2005 12:09:17 -0000 1.19 --- Verifiable.h 27 Feb 2005 11:48:14 -0000 1.20 *************** *** 64,68 **** /** Throws an AssertionFailedException if any expectations have not been met. */ ! virtual void verify() const = 0; /** Gets the name of the current mock object. --- 64,73 ---- /** Throws an AssertionFailedException if any expectations have not been met. */ ! virtual void verify() = 0; ! ! /** ! * Sets all internal data to the state after construction. ! */ ! virtual void reset() = 0; /** Gets the name of the current mock object. *************** *** 93,97 **** * @param idx index of object in the list * @return pointer to object */ ! virtual const Verifiable *getVerifiable(unsigned idx) const; private: --- 98,102 ---- * @param idx index of object in the list * @return pointer to object */ ! virtual Verifiable *getVerifiable(unsigned idx); private: Index: VerifyingTestCase.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VerifyingTestCase.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** VerifyingTestCase.h 30 Jan 2005 17:18:07 -0000 1.18 --- VerifyingTestCase.h 27 Feb 2005 11:48:14 -0000 1.19 *************** *** 79,83 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const; /** Removes all verifiable fields from the list. --- 79,83 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify(); /** Removes all verifiable fields from the list. Index: ExpectationSegment.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationSegment.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ExpectationSegment.h 26 Jan 2005 21:59:12 -0000 1.23 --- ExpectationSegment.h 27 Feb 2005 11:48:14 -0000 1.24 *************** *** 61,64 **** --- 61,72 ---- + /** Resets the internal state to reflect that there is no actual value set. + */ + virtual void reset() + { + clear(); + } + + /** Resets the internal state completely. */ *************** *** 121,125 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const { if( expectNothing ) --- 129,133 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() { if( expectNothing ) Index: ExpectationList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationList.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ExpectationList.h 26 Jan 2005 21:59:12 -0000 1.35 --- ExpectationList.h 27 Feb 2005 11:48:14 -0000 1.36 *************** *** 63,66 **** --- 63,73 ---- + /** Sets all internal objects to the state after construction. + */ + virtual void reset() + { + clear(); + } + /** * Verify that the expected values equal the expected ones. *************** *** 69,73 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const { if( expectNothing) --- 76,80 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() { if( expectNothing) Index: VerifyingTestCase.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VerifyingTestCase.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** VerifyingTestCase.cpp 30 Jan 2005 17:18:07 -0000 1.21 --- VerifyingTestCase.cpp 27 Feb 2005 11:48:14 -0000 1.22 *************** *** 71,75 **** ! void MOCKPP_EXPORT VerifyingTestCase::verify() const { if (numVerifiables() == 0) --- 71,75 ---- ! void MOCKPP_EXPORT VerifyingTestCase::verify() { if (numVerifiables() == 0) Index: ChainableMockObject.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ChainableMockObject.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ChainableMockObject.cpp 22 Jan 2005 20:41:04 -0000 1.14 --- ChainableMockObject.cpp 27 Feb 2005 11:48:14 -0000 1.15 *************** *** 52,56 **** ! void MOCKPP_EXPORT ChainableMockObject::verify() const { MockObject::verify(); --- 52,56 ---- ! void MOCKPP_EXPORT ChainableMockObject::verify() { MockObject::verify(); *************** *** 117,121 **** { idTable.insert( std::make_pair(id, builder) ); ! PendingType::iterator it; while ( (it = pendingRecorders.find( id )) != pendingRecorders.end() ) --- 117,121 ---- { idTable.insert( std::make_pair(id, builder) ); ! PendingType::iterator it; while ( (it = pendingRecorders.find( id )) != pendingRecorders.end() ) *************** *** 137,141 **** for (unsigned i = 0; i < allBuilders.size(); ++i) delete allBuilders[i]; ! allBuilders.clear(); while(pendingRecorders.size() != 0) --- 137,141 ---- for (unsigned i = 0; i < allBuilders.size(); ++i) delete allBuilders[i]; ! allBuilders.clear(); while(pendingRecorders.size() != 0) Index: ExpectationBoundary.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationBoundary.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ExpectationBoundary.h 26 Jan 2005 21:59:11 -0000 1.16 --- ExpectationBoundary.h 27 Feb 2005 11:48:14 -0000 1.17 *************** *** 126,129 **** --- 126,137 ---- + /** Resets the internal state to reflect that there is no actual value set. + */ + virtual void reset() + { + clear(); + } + + /** * Resets the internal state completely. *************** *** 168,172 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const { if( expectNothing ) --- 176,180 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() { if( expectNothing ) Index: MockObject.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/MockObject.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** MockObject.h 6 Jan 2005 13:09:21 -0000 1.19 --- MockObject.h 27 Feb 2005 11:48:14 -0000 1.20 *************** *** 67,71 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const; private: --- 67,75 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify(); ! ! /** Sets all internal objects to the state after construction. ! */ ! virtual void reset(); private: *************** *** 78,82 **** * @param anObject The object to be verified. */ ! static void verifyAnObject(const VerifiableList* anObject); /** Verifies all fields in an object --- 82,86 ---- * @param anObject The object to be verified. */ ! static void verifyAnObject(VerifiableList* anObject); /** Verifies all fields in an object *************** *** 84,88 **** * @param alreadyProcessed contain already processed objects (check only once) */ ! static void verifySubFields(const Verifiable *anObject, VerifierVec &alreadyProcessed); --- 88,92 ---- * @param alreadyProcessed contain already processed objects (check only once) */ ! static void verifySubFields(Verifiable *anObject, VerifierVec &alreadyProcessed); *************** *** 91,95 **** * @param alreadyProcessed contain already processed objects (check only once) */ ! static void verifyField(const Verifiable *anObject, VerifierVec &alreadyProcessed); --- 95,99 ---- * @param alreadyProcessed contain already processed objects (check only once) */ ! static void verifyField(Verifiable *anObject, VerifierVec &alreadyProcessed); Index: ChainableMockObject.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ChainableMockObject.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ChainableMockObject.h 30 Jan 2005 12:09:16 -0000 1.21 --- ChainableMockObject.h 27 Feb 2005 11:48:14 -0000 1.22 *************** *** 120,124 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const; private: --- 120,124 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify(); private: Index: VerifiableList.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VerifiableList.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** VerifiableList.cpp 29 Jan 2005 13:54:47 -0000 1.17 --- VerifiableList.cpp 27 Feb 2005 11:48:14 -0000 1.18 *************** *** 47,51 **** ! void MOCKPP_EXPORT VerifiableList::addVerifiable (const Verifiable* vf) { if (vf != 0) --- 47,51 ---- ! void MOCKPP_EXPORT VerifiableList::addVerifiable (Verifiable* vf) { if (vf != 0) *************** *** 54,60 **** ! void MOCKPP_EXPORT VerifiableList::removeVerifiable (const Verifiable* vf) { ! std::vector<const Verifiable*>::iterator it = std::find (verifiables.begin(), verifiables.end(), vf); --- 54,60 ---- ! void MOCKPP_EXPORT VerifiableList::removeVerifiable (Verifiable* vf) { ! std::vector<Verifiable*>::iterator it = std::find (verifiables.begin(), verifiables.end(), vf); *************** *** 64,70 **** ! bool MOCKPP_EXPORT VerifiableList::hasVerifiable (const Verifiable* vf) const { ! std::vector<const Verifiable*>::const_iterator it = std::find(verifiables.begin(), verifiables.end(), vf); return it != verifiables.end(); --- 64,70 ---- ! bool MOCKPP_EXPORT VerifiableList::hasVerifiable (Verifiable* vf) const { ! std::vector<Verifiable*>::const_iterator it = std::find(verifiables.begin(), verifiables.end(), vf); return it != verifiables.end(); *************** *** 84,88 **** ! const Verifiable * MOCKPP_EXPORT VerifiableList::getVerifiable(unsigned idx) const { MOCKPP_ASSERT_TRUE(idx < verifiables.size()); --- 84,88 ---- ! Verifiable * MOCKPP_EXPORT VerifiableList::getVerifiable(unsigned idx) { MOCKPP_ASSERT_TRUE(idx < verifiables.size()); Index: TrackingCounter.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/TrackingCounter.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TrackingCounter.h 20 Feb 2005 00:16:51 -0000 1.3 --- TrackingCounter.h 27 Feb 2005 11:48:14 -0000 1.4 *************** *** 138,142 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const; /** Resets the internal state to reflect that there is no actual value set. --- 138,142 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify(); /** Resets the internal state to reflect that there is no actual value set. *************** *** 154,157 **** --- 154,161 ---- unsigned numClients () const; + /** Clears all internal states + */ + virtual void reset(); + protected: *************** *** 221,225 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const; /** Resets the internal state to reflect that there is no actual value set. --- 225,229 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify(); /** Resets the internal state to reflect that there is no actual value set. *************** *** 240,243 **** --- 244,251 ---- unsigned getTag(unsigned index) const; + /** Clears all internal states + */ + virtual void reset(); + private: Index: VisitableMockObject_template.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject_template.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** VisitableMockObject_template.h 30 Dec 2004 20:54:03 -0000 1.21 --- VisitableMockObject_template.h 27 Feb 2005 11:48:15 -0000 1.22 *************** *** 39,44 **** ! /** ! * Base class for all objects that return objects or throwables * depending on the parameters passed to a method. */ --- 39,43 ---- ! /** Base class for all objects that return objects or throwables * depending on the parameters passed to a method. */ *************** *** 47,52 **** public: ! /** ! * Construct a new empty vector * @param name Label used to identify vector * @param parent parent verifiable --- 46,50 ---- public: ! /** Construct a new empty vector * @param name Label used to identify vector * @param parent parent verifiable *************** *** 58,65 **** } ! /** ! * Verify that all expectations are met. */ ! virtual void verify() const { // tvec.verify(); Not this one because it NEVER runs empty, use counter[] instead --- 56,62 ---- } ! /** Verify that all expectations are met. */ ! virtual void verify() { // tvec.verify(); Not this one because it NEVER runs empty, use counter[] instead *************** *** 79,84 **** ! /** ! * Returns the amount of response values. * @return number of response values */ --- 76,80 ---- ! /** Returns the amount of response values. * @return number of response values */ *************** *** 96,101 **** ! /** ! * Class returning a throwable depending on the parameters * passed to a method. */ --- 92,96 ---- ! /** Class returning a throwable depending on the parameters * passed to a method. */ *************** *** 105,110 **** public: ! /** ! * Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable --- 100,104 ---- public: ! /** Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable *************** *** 114,119 **** {} ! /** ! * Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return --- 108,112 ---- {} ! /** Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return *************** *** 127,132 **** } ! /** ! * Removes all the objects from the list. */ void clear() --- 120,131 ---- } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! /** Removes all the objects from the list. */ void clear() *************** *** 137,142 **** } ! /** ! * Finds a throwable for a set of parameters. * @param t the throwable * @param t1 the parameter upon which to return --- 136,140 ---- } ! /** Finds a throwable for a set of parameters. * @param t the throwable * @param t1 the parameter upon which to return *************** *** 166,171 **** ! /** ! * Class returning an object depending on the parameters * passed to a method. */ --- 164,168 ---- ! /** Class returning an object depending on the parameters * passed to a method. */ *************** *** 175,180 **** public: ! /** ! * Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable --- 172,176 ---- public: ! /** Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable *************** *** 184,189 **** {} ! /** ! * Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return --- 180,184 ---- {} ! /** Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return *************** *** 198,203 **** } ! /** ! * Adds a return valule. * @param r the return value * @param t1 the parameter upon which to return --- 193,197 ---- } ! /** Adds a return valule. * @param r the return value * @param t1 the parameter upon which to return *************** *** 210,215 **** } ! /** ! * Removes all the objects from the list. */ void clear() --- 204,215 ---- } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! /** Removes all the objects from the list. */ void clear() *************** *** 228,233 **** #endif ! /** ! * Finds a return value for a set of parameters. * @param r the value * @param t1 the parameter upon which to return --- 228,232 ---- #endif ! /** Finds a return value for a set of parameters. * @param r the value * @param t1 the parameter upon which to return *************** *** 257,262 **** ! /** ! * Class returning a throwable depending on the parameters * passed to a method. */ --- 256,260 ---- ! /** Class returning a throwable depending on the parameters * passed to a method. */ *************** *** 266,271 **** public: ! /** ! * Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable --- 264,268 ---- public: ! /** Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable *************** *** 275,280 **** {} ! /** ! * Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return --- 272,276 ---- {} ! /** Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return *************** *** 290,295 **** } ! /** ! * Removes all the objects from the list. */ void clear() --- 286,297 ---- } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! /** Removes all the objects from the list. */ void clear() *************** *** 301,306 **** } ! /** ! * Finds a throwable for a set of parameters. * @param t the throwable * @param t1 the parameter upon which to return --- 303,307 ---- } ! /** Finds a throwable for a set of parameters. * @param t the throwable * @param t1 the parameter upon which to return *************** *** 334,339 **** ! /** ! * Class returning an object depending on the parameters * passed to a method. */ --- 335,339 ---- ! /** Class returning an object depending on the parameters * passed to a method. */ *************** *** 343,348 **** public: ! /** ! * Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable --- 343,347 ---- public: ! /** Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable *************** *** 352,357 **** {} ! /** ! * Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return --- 351,355 ---- {} ! /** Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return *************** *** 367,372 **** } ! /** ! * Adds a return value. * @param r the return value * @param t1 the parameter upon which to return --- 365,369 ---- } ! /** Adds a return value. * @param r the return value * @param t1 the parameter upon which to return *************** *** 380,385 **** } ! /** ! * Removes all the objects from the list. */ void clear() --- 377,388 ---- } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! /** Removes all the objects from the list. */ void clear() *************** *** 398,403 **** #endif ! /** ! * Finds a return value for a set of parameters. * @param r the value * @param t1 the parameter 1 upon which to return --- 401,405 ---- #endif ! /** Finds a return value for a set of parameters. * @param r the value * @param t1 the parameter 1 upon which to return *************** *** 430,435 **** ! /** ! * Class returning a throwable depending on the parameters * passed to a method. */ --- 432,436 ---- ! /** Class returning a throwable depending on the parameters * passed to a method. */ *************** *** 439,444 **** public: ! /** ! * Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable --- 440,444 ---- public: ! /** Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable *************** *** 448,453 **** {} ! /** ! * Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return --- 448,452 ---- {} ! /** Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return *************** *** 464,469 **** } ! /** ! * Removes all the objects from the list. */ void clear() --- 463,474 ---- } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! /** Removes all the objects from the list. */ void clear() *************** *** 476,481 **** } ! /** ! * Finds a throwable for a set of parameters. * @param t the throwable * @param t1 the parameter 1 upon which to return --- 481,485 ---- } ! /** Finds a throwable for a set of parameters. * @param t the throwable * @param t1 the parameter 1 upon which to return *************** *** 512,517 **** ! /** ! * Class returning an object depending on the parameters * passed to a method. */ --- 516,520 ---- ! /** Class returning an object depending on the parameters * passed to a method. */ *************** *** 521,526 **** public: ! /** ! * Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable --- 524,528 ---- public: ! /** Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable *************** *** 530,535 **** {} ! /** ! * Adds a return value. * @param t the return value * @param t1 the parameter upon which to return --- 532,536 ---- {} ! /** Adds a return value. * @param t the return value * @param t1 the parameter upon which to return *************** *** 544,551 **** R r; rvec.push_back(r); ! } ! /** ! * Adds a throwable. * @param r the throwable * @param t1 the parameter upon which to return --- 545,551 ---- R r; rvec.push_back(r); ! } ! /** Adds a throwable. * @param r the throwable * @param t1 the parameter upon which to return *************** *** 560,565 **** } ! /** ! * Removes all the objects from the list. */ void clear() --- 560,571 ---- } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! /** Removes all the objects from the list. */ void clear() *************** *** 578,583 **** #endif ! /** ! * Finds a return value for a set of parameters. * @param r the value * @param t1 the parameter 1 upon which to return --- 584,588 ---- #endif ! /** Finds a return value for a set of parameters. * @param r the value * @param t1 the parameter 1 upon which to return *************** *** 612,617 **** ! /** ! * Class returning a throwable depending on the parameters * passed to a method. */ --- 617,621 ---- ! /** Class returning a throwable depending on the parameters * passed to a method. */ *************** *** 621,626 **** public: ! /** ! * Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable --- 625,629 ---- public: ! /** Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable *************** *** 630,635 **** {} ! /** ! * Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return --- 633,637 ---- {} ! /** Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return *************** *** 649,654 **** } ! /** ! * Removes all the objects from the list. */ void clear() --- 651,662 ---- } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! /** Removes all the objects from the list. */ void clear() *************** *** 662,667 **** } ! /** ! * Finds a throwable for a set of parameters. * @param t the throwable * @param t1 the parameter 1 upon which to return --- 670,674 ---- } ! /** Finds a throwable for a set of parameters. * @param t the throwable * @param t1 the parameter 1 upon which to return *************** *** 701,706 **** ! /** ! * Class returning an object depending on the parameters * passed to a method. */ --- 708,712 ---- ! /** Class returning an object depending on the parameters * passed to a method. */ *************** *** 710,715 **** public: ! /** ! * Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable --- 716,720 ---- public: ! /** Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable *************** *** 719,724 **** {} ! /** ! * Adds a return value. * @param r the return value * @param t1 the parameter upon which to return --- 724,728 ---- {} ! /** Adds a return value. * @param r the return value * @param t1 the parameter upon which to return *************** *** 734,739 **** } ! /** ! * Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return --- 738,742 ---- } ! /** Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return *************** *** 751,756 **** } ! /** ! * Removes all the objects from the list. */ void clear() --- 754,765 ---- } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! /** Removes all the objects from the list. */ void clear() *************** *** 770,775 **** #endif ! /** ! * Finds a return value for a set of parameters. * @param r the value * @param t1 the parameter 1 upon which to return --- 779,783 ---- #endif ! /** Finds a return value for a set of parameters. * @param r the value * @param t1 the parameter 1 upon which to return *************** *** 806,811 **** ! /** ! * Class returning a throwable depending on the parameters * passed to a method. */ --- 814,818 ---- ! /** Class returning a throwable depending on the parameters * passed to a method. */ *************** *** 824,829 **** {} ! /** ! * Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return --- 831,835 ---- {} ! /** Adds a throwable. * @param t the throwable * @param t1 the parameter upon which to return *************** *** 845,850 **** } ! /** ! * Removes all the objects from the list. */ void clear() --- 851,862 ---- } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! /** Removes all the objects from the list. */ void clear() *************** *** 859,864 **** } ! /** ! * Finds a throwable for a set of parameters. * @param t the throwable * @param t1 the parameter 1 upon which to return --- 871,875 ---- } ! /** Finds a throwable for a set of parameters. * @param t the throwable * @param t1 the parameter 1 upon which to return *************** *** 901,906 **** ! /** ! * Class returning a throwable depending on the parameters * passed to a method. */ --- 912,916 ---- ! /** Class returning a throwable depending on the parameters * passed to a method. */ *************** *** 910,915 **** public: ! /** ! * Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable --- 920,924 ---- public: ! /** Construct a new empty vector * @param aName Label used to identify vector * @param parent parent verifiable *************** *** 919,924 **** {} ! /** ! * Adds a throwable. * @param t the throwable * @param t1 the parameter 1 upon which to return --- 928,932 ---- {} ! /** Adds a throwable. * @param t the throwable * @param t1 the parameter 1 upon which to return *************** *** 937,942 **** } ! /** ! * Adds a return value. * @param r the return value * @param t1 the parameter 1 upon which to return --- 945,949 ---- } ! /** Adds a return value. * @param r the return value * @param t1 the parameter 1 upon which to return *************** *** 953,958 **** } ! /** ! * Removes all the objects from the list. */ void clear() --- 960,971 ---- } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! /** Removes all the objects from the list. */ void clear() *************** *** 971,976 **** #endif ! /** ! * Finds a return value for a set of parameters. * @param r the value * @param t1 the parameter 1 upon which to return --- 984,988 ---- #endif ! /** Finds a return value for a set of parameters. * @param r the value * @param t1 the parameter 1 upon which to return Index: ExpectationSet.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationSet.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ExpectationSet.h 26 Jan 2005 21:59:12 -0000 1.29 --- ExpectationSet.h 27 Feb 2005 11:48:14 -0000 1.30 *************** *** 123,127 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const { if( expectNothing) --- 123,127 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() { if( expectNothing) *************** *** 169,172 **** --- 169,180 ---- + /** Resets the internal state to reflect that there is no actual value set. + */ + virtual void reset() + { + clear(); + } + + /** * Resets the internal state completely. Index: VisitableMockObject.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** VisitableMockObject.h 6 Jan 2005 13:09:21 -0000 1.33 --- VisitableMockObject.h 27 Feb 2005 11:48:14 -0000 1.34 *************** *** 42,45 **** --- 42,47 ---- #include <mockpp/ReturnObjectList.h> + #include <mockpp/constraint/ConstraintList.h> + #include <mockpp/VisitableMockObject_macro.h> #include <mockpp/VisitableMockObject_template.h> *************** *** 67,71 **** * If it fails, an AssertionFailedError is thrown [...1153 lines suppressed...] */ #define MOCKPP_CONSTRUCT_MEMBERS_FOR_VISITABLE5(name) \ ! MOCKPP_CONSTRUCT_MEMBERS_FOR_VISITABLE0(name), \ ! MOCKPP_CONSTRUCT_PARAMETER5_VISITABLE_MEMBERS(name) /** Implements the initializers for the internal variables of a *************** *** 1371,1376 **** */ #define MOCKPP_CONSTRUCT_MEMBERS_FOR_VISITABLE_EXT5(m_name, x_name) \ ! MOCKPP_CONSTRUCT_MEMBERS_FOR_VISITABLE_EXT0(m_name, x_name), \ ! MOCKPP_CONSTRUCT_PARAMETER5_VISITABLE_MEMBERS(m_name ## x_name) --- 1421,1425 ---- */ #define MOCKPP_CONSTRUCT_MEMBERS_FOR_VISITABLE_EXT5(m_name, x_name) \ ! MOCKPP_CONSTRUCT_MEMBERS_FOR_VISITABLE5(m_name ## x_name) Index: ExpectationCounter.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationCounter.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ExpectationCounter.h 26 Jan 2005 21:59:12 -0000 1.21 --- ExpectationCounter.h 27 Feb 2005 11:48:14 -0000 1.22 *************** *** 62,65 **** --- 62,68 ---- virtual void clear(); + /** Clears all internal states + */ + virtual void reset(); /** Increments the actual number of calls by 1. *************** *** 99,103 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const; protected: --- 102,106 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify(); protected: Index: ExpectationConglomeration.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationConglomeration.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ExpectationConglomeration.h 26 Jan 2005 21:59:12 -0000 1.15 --- ExpectationConglomeration.h 27 Feb 2005 11:48:14 -0000 1.16 *************** *** 133,136 **** --- 133,144 ---- + /** Resets the internal state to reflect that there is no actual value set. + */ + virtual void reset() + { + clear(); + } + + /** * Resets the internal state completely. *************** *** 161,165 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const { if( expectNothing) --- 169,173 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() { if( expectNothing) Index: Makefile.am =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/Makefile.am,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Makefile.am 20 Feb 2005 00:18:46 -0000 1.68 --- Makefile.am 27 Feb 2005 11:48:14 -0000 1.69 *************** *** 106,111 **** perl -i.bak -pe "s/(visitmock)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf perl -i.bak -pe "s/(poormock)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf ! perl -i.bak -pe "s/(poormock_se)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf ! perl -i.bak -pe "s/(poormock-se)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf perl -i.bak -pe "s/(mock_greeter)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf perl -i.bak -pe "s/(mock_test)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf --- 106,111 ---- perl -i.bak -pe "s/(visitmock)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf perl -i.bak -pe "s/(poormock)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf ! perl -i.bak -pe "s/(poormock_se)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf ! perl -i.bak -pe "s/(poormock-se)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf perl -i.bak -pe "s/(mock_greeter)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf perl -i.bak -pe "s/(mock_test)_(\d*)(\.exe)/\1_$(LT_CURRENT)\3/g" $(top_srcdir)/bcb5/*.bpr $(top_srcdir)/bcbX/*.cbx $(top_srcdir)/bcb5/*.bpf Index: Verifiable.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/Verifiable.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Verifiable.cpp 25 Jan 2005 22:39:45 -0000 1.19 --- Verifiable.cpp 27 Feb 2005 11:48:14 -0000 1.20 *************** *** 81,85 **** ! const Verifiable * MOCKPP_EXPORT Verifiable::getVerifiable(unsigned /*idx*/) const { return 0; --- 81,85 ---- ! Verifiable * MOCKPP_EXPORT Verifiable::getVerifiable(unsigned /*idx*/) { return 0; Index: ThrowableList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ThrowableList.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ThrowableList.h 6 Jan 2005 13:09:21 -0000 1.15 --- ThrowableList.h 27 Feb 2005 11:48:14 -0000 1.16 *************** *** 50,55 **** public: ! /** ! * Construct a new empty list * @param aName Label used to identify list * @param parent parent verifiable --- 50,54 ---- public: ! /** Construct a new empty list * @param aName Label used to identify list * @param parent parent verifiable *************** *** 57,67 **** ThrowableList(const String &aName, VerifiableList *parent); ! /** ! * Destruct the list. */ virtual ~ThrowableList() throw(); ! /** ! * Add a next object to the end of the list. * The objects remains from now on in the responsibiliy of this list until * the list itself is destroyed! This is valid even for objects taken via --- 56,64 ---- ThrowableList(const String &aName, VerifiableList *parent); ! /** Destruct the list. */ virtual ~ThrowableList() throw(); ! /** Add a next object to the end of the list. * The objects remains from now on in the responsibiliy of this list until * the list itself is destroyed! This is valid even for objects taken via *************** *** 72,77 **** void push_back(Throwable *t); ! /** ! * Add a next object to the end of the list. * The objects remains from now on in the responsibiliy of this list until * the list itself is destroyed! This is valid even for objects taken via --- 69,73 ---- void push_back(Throwable *t); ! /** Add a next object to the end of the list. * The objects remains from now on in the responsibiliy of this list until * the list itself is destroyed! This is valid even for objects taken via *************** *** 85,101 **** } ! /** ! * Returns the next object from the list. Each object it returned in the * order in which they where added. */ Throwable *nextThrowableObject(); ! /** ! * Returns true if there are more objects to be returned. */ bool hasMoreObjects() const; ! /** ! * Returns a pointer to the specified object in the list. * The list is not changed! * @param i index of the object --- 81,94 ---- } ! /** Returns the next object from the list. Each object it returned in the * order in which they where added. */ Throwable *nextThrowableObject(); ! /** Returns true if there are more objects to be returned. */ bool hasMoreObjects() const; ! /** Returns a pointer to the specified object in the list. * The list is not changed! * @param i index of the object *************** *** 103,119 **** Throwable * at(unsigned i); ! /** ! * Removes all the objects from the list. */ void clear(); ! /** ! * Verify that there are no objects left within the list. * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const; ! /** ! * Returns the amount of response values. * The count covers already used and still unused obbjects! * @return number of response values --- 96,113 ---- Throwable * at(unsigned i); ! /** Removes all the objects from the list. */ void clear(); ! /** Verify that there are no objects left within the list. * If it fails, an AssertionFailedError is thrown */ ! virtual void verify(); ! /** Sets all internal objects to the state after construction. ! */ ! virtual void reset(); ! ! /** Returns the amount of response values. * The count covers already used and still unused obbjects! * @return number of response values Index: ReturnObjectList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ReturnObjectList.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ReturnObjectList.h 6 Jan 2005 13:09:21 -0000 1.22 --- ReturnObjectList.h 27 Feb 2005 11:48:14 -0000 1.23 *************** *** 62,73 **** class ReturnObjectList : public Verifiable { - private: - - std::deque<T> myObjects; - public: ! /** ! * Construct a new empty list * @param name Label used to identify list * @param parent parent verifiable --- 62,68 ---- class ReturnObjectList : public Verifiable { public: ! /** Construct a new empty list * @param name Label used to identify list * @param parent parent verifiable *************** *** 75,84 **** ReturnObjectList(const String &name, VerifiableList *parent) : Verifiable (name, parent) { } ! /** ! * Add a next object to the end of the list. * @param anObjectToReturn object to be added to the list */ --- 70,87 ---- ReturnObjectList(const String &name, VerifiableList *parent) : Verifiable (name, parent) + , haveDefault(false) { } ! /** Removes all the objects from the list. ! */ ! virtual void reset() ! { ! clear(); ! } ! ! ! /** Add a next object to the end of the list. * @param anObjectToReturn object to be added to the list */ *************** *** 89,94 **** ! /** ! * Add a sequence of next objects to the end of the list. * @param items start iterator * @param end terminating iterator (note: one element "behind" as always with STL) --- 92,96 ---- ! /** Add a sequence of next objects to the end of the list. * @param items start iterator * @param end terminating iterator (note: one element "behind" as always with STL) *************** *** 102,107 **** ! /** ! * Returns the next object from the list. Each object it returned in the * order in which they where added. */ --- 104,119 ---- ! /** Sets a default object which is returned when the list is empty. ! * Using the default object does not affect the behaviour of verify(). ! * @param defaultObj default object to return ! */ ! void setDefaultReturnVaue(const T &defaultObj) ! { ! haveDefault = true; ! defaultObject = defaultObj; ! } ! ! ! /** Returns the next object from the list. Each object it returned in the * order in which they where added. */ *************** *** 111,117 **** fmt << getVerifiableName(); MOCKPP_ASSERT_TRUE_MESSAGE(fmt, myObjects.size() > 0); - T temp = myObjects.front(); myObjects.pop_front(); return temp; --- 123,132 ---- fmt << getVerifiableName(); + if (myObjects.size() == 0 && haveDefault) + return defaultObject; + MOCKPP_ASSERT_TRUE_MESSAGE(fmt, myObjects.size() > 0); + T temp = myObjects.front(); myObjects.pop_front(); return temp; *************** *** 119,133 **** ! /** ! * Removes all the objects from the list. */ void clear() { myObjects.clear(); } ! /** ! * Returns true if there are more objects to be returned. */ bool hasMoreObjects() const --- 134,147 ---- ! /** Removes all the objects from the list. */ void clear() { + haveDefault = false; myObjects.clear(); } ! /** Returns true if there are more objects to be returned. */ bool hasMoreObjects() const *************** *** 137,145 **** ! /** ! * Verify that there are no objects left within the list. * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const { String fmt = i18n(MOCKPP_PCHAR("%1 has %2 un-used objects.")); --- 151,158 ---- ! /** Verify that there are no objects left within the list. * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() { String fmt = i18n(MOCKPP_PCHAR("%1 has %2 un-used objects.")); *************** *** 148,151 **** --- 161,170 ---- MOCKPP_ASSERT_EQUALS_MESSAGE(fmt, (size_t)0, myObjects.size()); } + + private: + + std::deque<T> myObjects; + bool haveDefault; + T defaultObject; }; Index: ExpectationCounter.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationCounter.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ExpectationCounter.cpp 8 Jan 2005 13:24:10 -0000 1.20 --- ExpectationCounter.cpp 27 Feb 2005 11:48:14 -0000 1.21 *************** *** 60,63 **** --- 60,68 ---- + void MOCKPP_EXPORT ExpectationCounter::reset() + { + clear(); + } + void MOCKPP_EXPORT ExpectationCounter::clear() { *************** *** 114,118 **** ! void MOCKPP_EXPORT ExpectationCounter::verify() const { if (!this->hasExpectations() ) --- 119,123 ---- ! void MOCKPP_EXPORT ExpectationCounter::verify() { if (!this->hasExpectations() ) Index: AbstractExpectation.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/AbstractExpectation.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** AbstractExpectation.h 30 Dec 2004 20:54:03 -0000 1.22 --- AbstractExpectation.h 27 Feb 2005 11:48:14 -0000 1.23 *************** *** 102,106 **** * If this fails an AssertionFailedError is thrown. */ ! virtual void verify() const = 0; protected: --- 102,106 ---- * If this fails an AssertionFailedError is thrown. */ ! virtual void verify() = 0; protected: Index: VerifiableList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VerifiableList.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** VerifiableList.h 25 Jan 2005 22:39:47 -0000 1.15 --- VerifiableList.h 27 Feb 2005 11:48:14 -0000 1.16 *************** *** 68,82 **** * @param vf pointer to the verifiable object */ ! virtual void addVerifiable (const Verifiable* vf); /** Removes a verifiable object from the list. * @param vf pointer to the verifiable object */ ! void removeVerifiable (const Verifiable* vf); /** Tests of a verifiable object is in the list. * @param vf pointer to the verifiable object */ ! bool hasVerifiable (const Verifiable* vf) const; /** Gets the number of verifiable sub-objects in the list. --- 68,82 ---- * @param vf pointer to the verifiable object */ ! virtual void addVerifiable (Verifiable* vf); /** Removes a verifiable object from the list. * @param vf pointer to the verifiable object */ ! void removeVerifiable (Verifiable* vf); /** Tests of a verifiable object is in the list. * @param vf pointer to the verifiable object */ ! bool hasVerifiable (Verifiable* vf) const; /** Gets the number of verifiable sub-objects in the list. *************** *** 89,93 **** * @return pointer to object or 0 when index too high */ ! virtual const Verifiable *getVerifiable(unsigned idx) const; /** Removes all verifiable fields from the list. --- 89,93 ---- * @return pointer to object or 0 when index too high */ ! virtual Verifiable *getVerifiable(unsigned idx); /** Removes all verifiable fields from the list. *************** *** 97,101 **** private: ! std::vector<const Verifiable*> verifiables; }; --- 97,101 ---- private: ! std::vector<Verifiable*> verifiables; }; Index: ExpectationValue.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationValue.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ExpectationValue.h 26 Jan 2005 21:59:12 -0000 1.28 --- ExpectationValue.h 27 Feb 2005 11:48:14 -0000 1.29 *************** *** 73,76 **** --- 73,84 ---- + /** Resets the internal state to reflect that there is no actual value set. + */ + virtual void reset() + { + clear(); + } + + /** Resets the internal state completely. */ *************** *** 124,128 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() const { if( expectNothing ) --- 132,136 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() { if( expectNothing ) |