mockpp-commits Mailing List for Mock Objects for C++ (Page 24)
Brought to you by:
ewald-arnold
You can subscribe to this list here.
2005 |
Jan
|
Feb
(17) |
Mar
(178) |
Apr
(119) |
May
(60) |
Jun
(3) |
Jul
(60) |
Aug
(16) |
Sep
(55) |
Oct
(156) |
Nov
(136) |
Dec
(255) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(98) |
Feb
(8) |
Mar
(57) |
Apr
(43) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Ewald A. <ewa...@us...> - 2005-11-13 11:53:29
|
Update of /cvsroot/mockpp/mockpp/mockpp/builder In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27653/mockpp/builder Modified Files: ArgumentsMatchBuilderN.h BuilderNamespace.h Log Message: cleanup: migrate clear() to reset() Index: BuilderNamespace.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/builder/BuilderNamespace.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- BuilderNamespace.h 30 Jan 2005 12:09:17 -0000 1.24 +++ BuilderNamespace.h 13 Nov 2005 11:53:18 -0000 1.25 @@ -93,7 +93,7 @@ /** Frees all internal data. * @internal */ - virtual void clear() = 0; + virtual void reset() = 0; /** Stores another recorder object for later use. * @internal |
From: Ewald A. <ewa...@us...> - 2005-11-13 11:53:29
|
Update of /cvsroot/mockpp/mockpp/mockpp/constraint In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27653/mockpp/constraint Modified Files: ConstraintList.h ConstraintSetN.h Log Message: cleanup: migrate clear() to reset() Index: ConstraintList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/constraint/ConstraintList.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ConstraintList.h 31 Jul 2005 14:12:44 -0000 1.5 +++ ConstraintList.h 13 Nov 2005 11:53:18 -0000 1.6 @@ -73,14 +73,7 @@ */ virtual ~ConstraintList() { - clear(); - } - - /** Sets all internal objects to the state after construction. - */ - virtual void reset() - { - clear(); + reset(); } /** Verify that the expected values equal the expected ones. @@ -207,7 +200,7 @@ /** * Resets the internal state completely. */ - virtual void clear() + virtual void reset() { this->clearFailOnVerify(); clearActual(); |
From: Ewald A. <ewa...@us...> - 2005-11-13 11:53:29
|
Update of /cvsroot/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27653 Modified Files: ChangeLog mockpp.kdevelop Log Message: cleanup: migrate clear() to reset() Index: mockpp.kdevelop =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp.kdevelop,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- mockpp.kdevelop 3 Oct 2005 09:54:39 -0000 1.78 +++ mockpp.kdevelop 13 Nov 2005 11:53:18 -0000 1.79 @@ -24,7 +24,7 @@ <useconfiguration>unicode</useconfiguration> </general> <run> - <mainprogram>mockpp/tests/jmock_test</mainprogram> + <mainprogram>mockpp/tests/mock_test</mainprogram> <programargs/> <terminal>false</terminal> <envvars/> Index: ChangeLog =================================================================== RCS file: /cvsroot/mockpp/mockpp/ChangeLog,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- ChangeLog 28 Oct 2005 19:10:39 -0000 1.72 +++ ChangeLog 13 Nov 2005 11:53:18 -0000 1.73 @@ -10,6 +10,8 @@ - created generator scripts to build classes based on increasing numbers of parameters to enable methods with more than 5 parameters - added template based classes to mock methods (chainable and visitable) + - compatibilty break: cleanup and removed all methods clear() as they were + mostly duplicates of reset() 2005-10-11 1.9.5: |
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27653/mockpp Modified Files: AbstractExpectationCollection.h ChainableMockObject.cpp ChainableMockObject.h CountParameters.h CountedVisitableMethod.h ExpectationBoundary.h ExpectationConglomeration.h ExpectationCounter.cpp ExpectationCounter.h ExpectationList.h ExpectationMap.h ExpectationSegment.h ExpectationSet.h ExpectationValue.h MixedMockObject.cpp MixedMockObject.h ResponseVector1.h ResponseVector2.h ResponseVector3.h ResponseVector4.h ResponseVector5.h ResponseVector6.h ReturnObjectList.h Throwable.cpp Throwable.h ThrowableList.cpp ThrowableList.h TrackingCounter.cpp TrackingCounter.h VisitableMockObject.cpp VisitableMockObject.h VisitableMockObject_macro.h gen_responsevector_N.pl Log Message: cleanup: migrate clear() to reset() Index: ResponseVector3.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ResponseVector3.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ResponseVector3.h 31 Oct 2005 19:01:00 -0000 1.6 +++ ResponseVector3.h 13 Nov 2005 11:53:18 -0000 1.7 @@ -1,7 +1,7 @@ /** @file @internal NOT INTENDED FOR PUBLIC INCLUSION @brief Generated with gen_responsevector_N.pl. - + $Id$ ***************************************************************************/ @@ -102,17 +102,10 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { counter.clear(); - tvec.clear(); + tvec.reset(); for (unsigned i1 = 0; i1 < t1vec.size(); ++i1) delete t1vec[i1]; @@ -245,16 +238,9 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { - ResponseThrowableVector3<P1, P2, P3>::clear(); + ResponseThrowableVector3<P1, P2, P3>::reset(); rvec.clear(); } Index: AbstractExpectationCollection.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/AbstractExpectationCollection.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- AbstractExpectationCollection.h 30 Dec 2004 20:54:03 -0000 1.16 +++ AbstractExpectationCollection.h 13 Nov 2005 11:53:18 -0000 1.17 @@ -70,7 +70,7 @@ /** * Resets the internal state completely. */ - virtual void clear() = 0; + virtual void reset() = 0; /** Index: TrackingCounter.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/TrackingCounter.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TrackingCounter.cpp 7 May 2005 12:45:10 -0000 1.9 +++ TrackingCounter.cpp 13 Nov 2005 11:53:18 -0000 1.10 @@ -69,7 +69,7 @@ } -void MOCKPP_EXPORT TrackingCounterBase::clear() +void MOCKPP_EXPORT TrackingCounterBase::reset() { clearActual(); clearExpectation(); @@ -176,11 +176,6 @@ } -void MOCKPP_EXPORT TrackingCounterMaster::reset() -{ - clearActual(); -} - void MOCKPP_EXPORT TrackingCounterMaster::clearActual() { myActualValue = 0; @@ -222,11 +217,6 @@ } -void MOCKPP_EXPORT TrackingCounterClient::reset() -{ - clearActual(); -} - void MOCKPP_EXPORT TrackingCounterClient::clearActual() { myActualValue = 0; Index: ResponseVector2.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ResponseVector2.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ResponseVector2.h 31 Oct 2005 19:01:00 -0000 1.6 +++ ResponseVector2.h 13 Nov 2005 11:53:18 -0000 1.7 @@ -1,7 +1,7 @@ /** @file @internal NOT INTENDED FOR PUBLIC INCLUSION @brief Generated with gen_responsevector_N.pl. - + $Id$ ***************************************************************************/ @@ -96,17 +96,10 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { counter.clear(); - tvec.clear(); + tvec.reset(); for (unsigned i1 = 0; i1 < t1vec.size(); ++i1) delete t1vec[i1]; @@ -226,16 +219,9 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { - ResponseThrowableVector2<P1, P2>::clear(); + ResponseThrowableVector2<P1, P2>::reset(); rvec.clear(); } Index: VisitableMockObject_macro.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject_macro.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- VisitableMockObject_macro.h 23 Oct 2005 10:54:49 -0000 1.33 +++ VisitableMockObject_macro.h 13 Nov 2005 11:53:18 -0000 1.34 @@ -50,38 +50,38 @@ //########################################################################## #define MOCKPP_IMPL_RESET_VOID_BASE(methname) \ - objptr->methname ## Throwables.clear(); \ - objptr->methname ## DefaultThrowable.clear(); \ + objptr->methname ## Throwables.reset(); \ + objptr->methname ## DefaultThrowable.reset(); \ objptr->methname ## ThrowablesInline = MOCKPP_THROWABLE_INLINE; \ objptr->methname ## ThrowableInsteadReturn.clear() #define MOCKPP_IMPL_RESET_BASE(methname) \ MOCKPP_IMPL_RESET_VOID_BASE(methname); \ - objptr->methname ## ReturnValues.clear(); \ + objptr->methname ## ReturnValues.reset(); \ objptr->methname ## haveDefaultReturnValue = false; \ objptr->methname ## DefaultReturnValueUsed = false //////////////////////////////////////////////////////////////////////////// #define MOCKPP_IMPL_RESET_P1(methname) \ - objptr->methname ## ResponseValues.clear(); \ - objptr->methname ## Parameter1.clear(); + objptr->methname ## ResponseValues.reset(); \ + objptr->methname ## Parameter1.reset(); #define MOCKPP_IMPL_RESET_P2(methname) \ MOCKPP_IMPL_RESET_P1(methname); \ - objptr->methname ## Parameter2.clear() + objptr->methname ## Parameter2.reset() #define MOCKPP_IMPL_RESET_P3(methname) \ MOCKPP_IMPL_RESET_P2(methname); \ - objptr->methname ## Parameter3.clear() + objptr->methname ## Parameter3.reset() #define MOCKPP_IMPL_RESET_P4(methname) \ MOCKPP_IMPL_RESET_P3(methname); \ - objptr->methname ## Parameter4.clear() + objptr->methname ## Parameter4.reset() #define MOCKPP_IMPL_RESET_P5(methname) \ MOCKPP_IMPL_RESET_P4(methname); \ - objptr->methname ## Parameter5.clear() + objptr->methname ## Parameter5.reset() //////////////////////////////////////////////////////////////////////////// Index: ExpectationCounter.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationCounter.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ExpectationCounter.h 27 Feb 2005 11:48:14 -0000 1.22 +++ ExpectationCounter.h 13 Nov 2005 11:53:18 -0000 1.23 @@ -59,10 +59,6 @@ /** Resets the internal state completely. */ - virtual void clear(); - - /** Clears all internal states - */ virtual void reset(); /** Increments the actual number of calls by 1. Index: VisitableMockObject.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- VisitableMockObject.cpp 11 Oct 2005 19:07:44 -0000 1.24 +++ VisitableMockObject.cpp 13 Nov 2005 11:53:18 -0000 1.25 @@ -135,6 +135,7 @@ void MOCKPP_EXPORT VisitableMockObject::verify() { + MockObject::verify(); visitableVerify(); } @@ -146,12 +147,6 @@ } -void MOCKPP_EXPORT VisitableMockObject::clear() -{ - reset(); -} - - ///////////////////////////////////////////////////////////////// Index: ExpectationConglomeration.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationConglomeration.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ExpectationConglomeration.h 7 May 2005 12:45:10 -0000 1.18 +++ ExpectationConglomeration.h 13 Nov 2005 11:53:18 -0000 1.19 @@ -136,15 +136,6 @@ */ virtual void reset() { - clear(); - } - - - /** - * Resets the internal state completely. - */ - virtual void clear() - { this->clearFailOnVerify(); clearActual(); clearExpectation(); Index: ExpectationValue.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationValue.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- ExpectationValue.h 7 May 2005 12:45:10 -0000 1.30 +++ ExpectationValue.h 13 Nov 2005 11:53:18 -0000 1.31 @@ -72,17 +72,9 @@ } - /** Resets the internal state to reflect that there is no actual value set. - */ - virtual void reset() - { - clear(); - } - - /** Resets the internal state completely. */ - virtual void clear() + virtual void reset() { this->clearFailOnVerify(); clearActual(); Index: Throwable.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/Throwable.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Throwable.h 6 Jan 2005 13:09:21 -0000 1.14 +++ Throwable.h 13 Nov 2005 11:53:18 -0000 1.15 @@ -93,7 +93,7 @@ /** * Resets the counter to 0. */ - void clear() + void reset() { thrown = 0; } @@ -195,7 +195,7 @@ /** * Sets the object into a clean and unused state */ - void clear(); + void reset(); /** * Queries if the throwable object was taken via get(). Index: ChainableMockObject.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ChainableMockObject.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- ChainableMockObject.cpp 28 Aug 2005 20:40:23 -0000 1.17 +++ ChainableMockObject.cpp 13 Nov 2005 11:53:18 -0000 1.18 @@ -46,7 +46,7 @@ MOCKPP_EXPORT ChainableMockObjectBase::~ChainableMockObjectBase() { - chainableClear(); + chainableReset(); } @@ -124,7 +124,7 @@ } -void MOCKPP_EXPORT ChainableMockObjectBase::chainableClear() +void MOCKPP_EXPORT ChainableMockObjectBase::chainableReset() { while(idTable.size() != 0) { @@ -156,7 +156,7 @@ MOCKPP_EXPORT ChainableMockObject::~ChainableMockObject() { - clear(); + reset(); } @@ -167,9 +167,10 @@ } -void MOCKPP_EXPORT ChainableMockObject::clear() +void MOCKPP_EXPORT ChainableMockObject::reset() { - chainableClear(); + MockObject::reset(); + chainableReset(); } Index: ChainableMockObject.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ChainableMockObject.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- ChainableMockObject.h 29 Oct 2005 21:00:25 -0000 1.28 +++ ChainableMockObject.h 13 Nov 2005 11:53:18 -0000 1.29 @@ -119,7 +119,7 @@ /** Frees all internal data. * @internal */ - virtual void chainableClear(); + virtual void chainableReset(); private: @@ -166,7 +166,7 @@ /** Frees all internal data. * @internal */ - virtual void clear(); + virtual void reset(); }; Index: gen_responsevector_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/gen_responsevector_N.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gen_responsevector_N.pl 27 Oct 2005 18:56:07 -0000 1.2 +++ gen_responsevector_N.pl 13 Nov 2005 11:53:18 -0000 1.3 @@ -13,16 +13,16 @@ $totalNumArgs = $ARGV[0]; if ($totalNumArgs < 5) { $totalNumArgs = 5; } - + for ($numArgs = 1; $numArgs <= $totalNumArgs; ++$numArgs) { open OUT, ">ResponseVector" . $numArgs . ".h"; print "Creating ResponseVector" . $numArgs . ".h\n"; -print OUT +print OUT "/** \@file \@internal NOT INTENDED FOR PUBLIC INCLUSION \@brief Generated with gen_responsevector_N.pl. - + \$I" . "d: ResponseVector" . $numArgs . ".h,v 1.7 2005/10/19 20:53:09 ewald-arnold Exp \$ ***************************************************************************/ @@ -68,18 +68,18 @@ } $templateParms .= "typename P$i"; } - if ($numArgs > 0) { + if ($numArgs > 0) { $templateParms_colon = ", " . $templateParms; } - + $templateArgs_colon = ""; $_ = $templateParms; s/typename //g; $templateArgs = $_; - if ($numArgs > 0) { + if ($numArgs > 0) { $templateArgs_colon = ", ". $templateArgs; } - + $parms = ""; for ($i = 1; $i <= $numArgs; ++$i) { if ($i > 1) { @@ -106,7 +106,7 @@ $args .= "p$i"; } - + $boundArgs = ""; for ($i = 1; $i <= $numArgs; ++$i) { if ($i > 1) { @@ -121,7 +121,7 @@ $argsAsMembers .= "P$i p$i;"; } - + $copyParms = ""; for ($i = 1; $i <= $numArgs; ++$i) { if ($i > 1) { @@ -139,7 +139,7 @@ $hArgs .= "h$i"; } - + $initArgs = ""; if ($numArgs > 0) { $initArgs = ":"; @@ -151,13 +151,13 @@ $initArgs .= "p$i(ip$i)"; } - + $argTypes = ""; for ($i = 1; $i <= $numArgs; ++$i) { $argTypes .= "typedef P$i p". ($i+1) . "_type; "; } - + print OUT " /** Class returning a throwable depending on the parameters * passed to a method. @@ -194,10 +194,10 @@ */ void add(Throwable *t, " . $parms . ", unsigned count) {"; - + for($p = 1; $p <= $numArgs; ++$p) { print OUT " const ConstraintHolder<P" . $p . "> h" . $p . " = new IsEqual<P" . $p . ">(p" . $p . ");" } - + print OUT " add(t, " . $hArgs . ", count); } @@ -212,16 +212,16 @@ * \@param count the number of times the object may be used */ void add(Throwable *t,"; - + for($p = 1; $p <= $numArgs; ++$p) { print OUT " const ConstraintHolder<P" . $p . "> &p" . $p . ","; } - + print OUT " unsigned count) { counter.push_back(count); tvec.push_back(t);"; - + for($p = 1; $p <= $numArgs; ++$p) { print OUT " typename mockpp::Constraint<P" . $p . ">::AP cons" . $p . " (p" . $p . ");"; } @@ -233,18 +233,11 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { counter.clear(); - tvec.clear();"; - + tvec.reset();"; + for($p = 1; $p <= $numArgs; ++$p) { print OUT " for (unsigned i" . $p . " = 0; i" . $p . " < t" . $p . "vec.size(); ++i" . $p . ") @@ -267,10 +260,10 @@ { for (unsigned i = 0; i < t1vec.size(); ++i) if ( counter[i] > 0"; - + for($p = 1; $p <= $numArgs; ++$p) { print OUT " && t" . $p . "vec[i]->eval(p" . $p . ")"; } - + print OUT " ) { @@ -339,7 +332,7 @@ * \@param count the number of times the object may be used */ void add(Throwable *t,"; - + for($p = 1; $p <= $numArgs; ++$p) { print OUT " const ConstraintHolder<P" . $p . "> &p" . $p . ","; } @@ -377,7 +370,7 @@ * \@param count the number of times the object may be used */ void add(const R &r,"; - + for($p = 1; $p <= $numArgs; ++$p) { print OUT " const ConstraintHolder<P" . $p . "> &p" . $p . ","; } @@ -390,16 +383,9 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { - ResponseThrowableVector" . $numArgs . "<" . $templateArgs . ">::clear(); + ResponseThrowableVector" . $numArgs . "<" . $templateArgs . ">::reset(); rvec.clear(); } Index: ResponseVector4.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ResponseVector4.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ResponseVector4.h 31 Oct 2005 19:01:00 -0000 1.6 +++ ResponseVector4.h 13 Nov 2005 11:53:18 -0000 1.7 @@ -1,7 +1,7 @@ /** @file @internal NOT INTENDED FOR PUBLIC INCLUSION @brief Generated with gen_responsevector_N.pl. - + $Id$ ***************************************************************************/ @@ -108,17 +108,10 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { counter.clear(); - tvec.clear(); + tvec.reset(); for (unsigned i1 = 0; i1 < t1vec.size(); ++i1) delete t1vec[i1]; @@ -264,16 +257,9 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { - ResponseThrowableVector4<P1, P2, P3, P4>::clear(); + ResponseThrowableVector4<P1, P2, P3, P4>::reset(); rvec.clear(); } Index: MixedMockObject.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/MixedMockObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- MixedMockObject.cpp 6 Mar 2005 21:45:52 -0000 1.1 +++ MixedMockObject.cpp 13 Nov 2005 11:53:18 -0000 1.2 @@ -37,7 +37,7 @@ MOCKPP_EXPORT MixedMockObject::MixedMockObject(const String &name, VerifiableList *parent) - : VerifiableList(name, parent) + : MockObject(name, parent) , VisitableMockObjectBase(name+MOCKPP_PCHAR("/Visitable"), parent) , ChainableMockObjectBase(name+MOCKPP_PCHAR("/Chainable")) { @@ -51,21 +51,17 @@ void MOCKPP_EXPORT MixedMockObject::verify() { + MockObject::verify(); visitableVerify(); chainableVerify(); } -void MOCKPP_EXPORT MixedMockObject::clear() -{ - reset(); -} - - void MOCKPP_EXPORT MixedMockObject::reset() { + MockObject::reset(); visitableReset(); - chainableClear(); + chainableReset(); } Index: ThrowableList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ThrowableList.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- ThrowableList.h 30 Apr 2005 15:06:05 -0000 1.19 +++ ThrowableList.h 13 Nov 2005 11:53:18 -0000 1.20 @@ -118,10 +118,6 @@ */ 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 */ Index: ResponseVector5.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ResponseVector5.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ResponseVector5.h 31 Oct 2005 19:01:00 -0000 1.6 +++ ResponseVector5.h 13 Nov 2005 11:53:18 -0000 1.7 @@ -1,7 +1,7 @@ /** @file @internal NOT INTENDED FOR PUBLIC INCLUSION @brief Generated with gen_responsevector_N.pl. - + $Id$ ***************************************************************************/ @@ -114,17 +114,10 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { counter.clear(); - tvec.clear(); + tvec.reset(); for (unsigned i1 = 0; i1 < t1vec.size(); ++i1) delete t1vec[i1]; @@ -283,16 +276,9 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { - ResponseThrowableVector5<P1, P2, P3, P4, P5>::clear(); + ResponseThrowableVector5<P1, P2, P3, P4, P5>::reset(); rvec.clear(); } Index: ExpectationList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationList.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- ExpectationList.h 7 May 2005 12:45:10 -0000 1.38 +++ ExpectationList.h 13 Nov 2005 11:53:18 -0000 1.39 @@ -62,13 +62,6 @@ } - /** Sets all internal objects to the state after construction. - */ - virtual void reset() - { - clear(); - } - /** * Verify that the expected values equal the expected ones. * Note: in a list there can be any number of elements of a given value and the order @@ -179,7 +172,7 @@ /** * Resets the internal state completely. */ - virtual void clear() + virtual void reset() { this->clearFailOnVerify(); clearActual(); Index: ResponseVector6.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ResponseVector6.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ResponseVector6.h 31 Oct 2005 19:01:00 -0000 1.4 +++ ResponseVector6.h 13 Nov 2005 11:53:18 -0000 1.5 @@ -1,7 +1,7 @@ /** @file @internal NOT INTENDED FOR PUBLIC INCLUSION @brief Generated with gen_responsevector_N.pl. - + $Id$ ***************************************************************************/ @@ -120,17 +120,10 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { counter.clear(); - tvec.clear(); + tvec.reset(); for (unsigned i1 = 0; i1 < t1vec.size(); ++i1) delete t1vec[i1]; @@ -302,16 +295,9 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { - ResponseThrowableVector6<P1, P2, P3, P4, P5, P6>::clear(); + ResponseThrowableVector6<P1, P2, P3, P4, P5, P6>::reset(); rvec.clear(); } Index: ExpectationMap.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationMap.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- ExpectationMap.h 24 Mar 2005 21:43:06 -0000 1.24 +++ ExpectationMap.h 13 Nov 2005 11:53:18 -0000 1.25 @@ -126,7 +126,7 @@ ExpectationSet<Key>::setExpectNothing; ExpectationSet<Key>::addActual; ExpectationSet<Key>::clearActual; - ExpectationSet<Key>::clear; + ExpectationSet<Key>::reset; ExpectationSet<Key>::hasExpectations; ExpectationSet<Key>::setFailOnVerify; ExpectationSet<Key>::verify; Index: ThrowableList.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ThrowableList.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- ThrowableList.cpp 7 May 2005 12:45:10 -0000 1.21 +++ ThrowableList.cpp 13 Nov 2005 11:53:18 -0000 1.22 @@ -45,7 +45,7 @@ MOCKPP_EXPORT ThrowableList::~ThrowableList() throw() { - clear(); + reset(); } @@ -105,7 +105,7 @@ } -void MOCKPP_EXPORT ThrowableList::clear() +void MOCKPP_EXPORT ThrowableList::reset() { for (unsigned i1 = 0; i1 < list.size(); ++i1) delete list[i1]; @@ -117,12 +117,6 @@ } -void MOCKPP_EXPORT ThrowableList::reset() -{ - clear(); -} - - void MOCKPP_EXPORT ThrowableList::verify() { String fmt = mockpp_i18n(MOCKPP_PCHAR("%1 has %2 un-used objects.")); Index: Throwable.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/Throwable.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Throwable.cpp 30 Dec 2004 20:54:03 -0000 1.13 +++ Throwable.cpp 13 Nov 2005 11:53:18 -0000 1.14 @@ -87,7 +87,7 @@ } -void MOCKPP_EXPORT ThrowableItem::clear() +void MOCKPP_EXPORT ThrowableItem::reset() { take((Throwable*)0); } Index: ExpectationCounter.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationCounter.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ExpectationCounter.cpp 7 May 2005 12:45:10 -0000 1.22 +++ ExpectationCounter.cpp 13 Nov 2005 11:53:18 -0000 1.23 @@ -61,11 +61,6 @@ void MOCKPP_EXPORT ExpectationCounter::reset() { - clear(); -} - -void MOCKPP_EXPORT ExpectationCounter::clear() -{ clearActual(); clearExpectation(); this->clearHasExpectations(); Index: MixedMockObject.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/MixedMockObject.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MixedMockObject.h 29 Oct 2005 21:00:26 -0000 1.2 +++ MixedMockObject.h 13 Nov 2005 11:53:18 -0000 1.3 @@ -42,9 +42,9 @@ /** A MockObject that merges all the advanced mock objects. * \ingroup grp_advanced_mo */ -class MixedMockObject : public VerifiableList - , public VisitableMockObjectBase - , public ChainableMockObjectBase +class MixedMockObject : public MockObject + , public VisitableMockObjectBase + , public ChainableMockObjectBase { public: @@ -60,10 +60,6 @@ /** Frees all internal data. */ - virtual void clear(); - - /** Frees all internal data. - */ virtual void reset(); /** Verifies the object and the mock objects it contains. Index: TrackingCounter.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/TrackingCounter.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TrackingCounter.h 6 Apr 2005 20:15:19 -0000 1.5 +++ TrackingCounter.h 13 Nov 2005 11:53:18 -0000 1.6 @@ -61,9 +61,9 @@ */ virtual void clearActual() = 0; - /** Resets the internal state completely. + /** Resets the internal state to reflect that there is no actual value set. */ - virtual void clear(); + virtual void reset(); /** Sets the exact number of expected value. * @param expectedValue number of expected value @@ -153,10 +153,6 @@ */ unsigned numClients () const; - /** Clears all internal states - */ - virtual void reset(); - protected: friend class TrackingCounterClient; @@ -246,10 +242,6 @@ */ unsigned getTag(unsigned index) const; - /** Clears all internal states - */ - virtual void reset(); - private: TrackingCounterClient (const TrackingCounterClient &); // forbid Index: ExpectationSegment.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationSegment.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- ExpectationSegment.h 7 May 2005 12:45:10 -0000 1.26 +++ ExpectationSegment.h 13 Nov 2005 11:53:18 -0000 1.27 @@ -60,17 +60,9 @@ } - /** Resets the internal state to reflect that there is no actual value set. - */ - virtual void reset() - { - clear(); - } - - /** Resets the internal state completely. */ - virtual void clear() + virtual void reset() { this->clearFailOnVerify(); clearActual(); Index: ExpectationSet.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationSet.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- ExpectationSet.h 7 May 2005 12:45:10 -0000 1.32 +++ ExpectationSet.h 13 Nov 2005 11:53:18 -0000 1.33 @@ -168,18 +168,10 @@ } - /** Resets the internal state to reflect that there is no actual value set. - */ - virtual void reset() - { - clear(); - } - - /** * Resets the internal state completely. */ - virtual void clear() + virtual void reset() { this->clearFailOnVerify(); clearActual(); Index: ExpectationBoundary.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ExpectationBoundary.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- ExpectationBoundary.h 29 Oct 2005 21:00:26 -0000 1.20 +++ ExpectationBoundary.h 13 Nov 2005 11:53:18 -0000 1.21 @@ -126,18 +126,10 @@ #endif - /** Resets the internal state to reflect that there is no actual value set. - */ - virtual void reset() - { - clear(); - } - - /** * Resets the internal state completely. */ - virtual void clear() + virtual void reset() { this->clearFailOnVerify(); clearActual(); Index: ResponseVector1.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ResponseVector1.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ResponseVector1.h 31 Oct 2005 19:01:00 -0000 1.6 +++ ResponseVector1.h 13 Nov 2005 11:53:18 -0000 1.7 @@ -1,7 +1,7 @@ /** @file @internal NOT INTENDED FOR PUBLIC INCLUSION @brief Generated with gen_responsevector_N.pl. - + $Id$ ***************************************************************************/ @@ -90,17 +90,10 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { counter.clear(); - tvec.clear(); + tvec.reset(); for (unsigned i1 = 0; i1 < t1vec.size(); ++i1) delete t1vec[i1]; @@ -207,16 +200,9 @@ /** Removes all the objects from the list. */ - virtual void reset() - { - clear(); - } - - /** Removes all the objects from the list. - */ - void clear() + void reset() { - ResponseThrowableVector1<P1>::clear(); + ResponseThrowableVector1<P1>::reset(); rvec.clear(); } Index: ReturnObjectList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ReturnObjectList.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- ReturnObjectList.h 31 Aug 2005 14:47:07 -0000 1.29 +++ ReturnObjectList.h 13 Nov 2005 11:53:18 -0000 1.30 @@ -74,14 +74,6 @@ } - /** 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 * @return reference to itself for chaining @@ -152,7 +144,7 @@ /** Removes all the objects from the list. */ - void clear() + void reset() { haveDefault = false; myObjects.clear(); Index: VisitableMockObject.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject.h,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- VisitableMockObject.h 23 Oct 2005 12:03:42 -0000 1.41 +++ VisitableMockObject.h 13 Nov 2005 11:53:18 -0000 1.42 @@ -137,7 +137,7 @@ * \ingroup grp_advanced_mo */ class VisitableMockObject : public MockObject - , public VisitableMockObjectBase + , public VisitableMockObjectBase { public: @@ -162,11 +162,6 @@ * Sets all internal objects to the state after construction. */ virtual void reset(); - - /** - * Sets all internal objects to the state after construction. - */ - virtual void clear(); }; @@ -205,8 +200,8 @@ virtual void unsetThrowablesInline() = 0; /** - * Verify the conditions which are not in the verify() chain of the - * visitable mock object. Located here instead of the object for traditional + * Verify the conditions which are not in the verify() chain of the + * visitable mock object. Located here instead of the object for traditional * reasons. * If it fails, an AssertionFailedError is thrown */ |
From: Ewald A. <ewa...@us...> - 2005-11-13 11:53:28
|
Update of /cvsroot/mockpp/mockpp/mockpp/chaining In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27653/mockpp/chaining Modified Files: AbstractDynamicChainingMock.h AbstractInvocationDispatcher.h ChainableMockMethod0.h ChainableMockMethod1.h ChainableMockMethod2.h ChainableMockMethod3.h ChainableMockMethod4.h ChainableMockMethod5.h ChainableMockMethod6.h ChainingMockBuilder.h CountedChainableMethod.h InvocationDispatcher.h InvocationN.h Log Message: cleanup: migrate clear() to reset() Index: ChainingMockBuilder.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainingMockBuilder.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- ChainingMockBuilder.h 28 Aug 2005 20:40:23 -0000 1.24 +++ ChainingMockBuilder.h 13 Nov 2005 11:53:18 -0000 1.25 @@ -139,7 +139,7 @@ */ void reset() { - buildernamespace->clear(); + buildernamespace->reset(); coreMock->reset(); } Index: InvocationDispatcher.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/InvocationDispatcher.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- InvocationDispatcher.h 30 Dec 2004 20:54:04 -0000 1.9 +++ InvocationDispatcher.h 13 Nov 2005 11:53:18 -0000 1.10 @@ -86,7 +86,7 @@ /** Frees all internal data. * @internal */ - virtual void clear() = 0; + virtual void reset() = 0; }; Index: AbstractInvocationDispatcher.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/AbstractInvocationDispatcher.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- AbstractInvocationDispatcher.h 8 Apr 2005 21:43:51 -0000 1.15 +++ AbstractInvocationDispatcher.h 13 Nov 2005 11:53:18 -0000 1.16 @@ -106,16 +106,9 @@ invokables[ i ] ->verify(); } - /** Removes all the objects from the list. - */ - virtual void reset() - { - clear(); - } - /** Clears all internal states */ - virtual void clear() + virtual void reset() { for ( unsigned i = 0; i < invokables.size(); ++i ) delete invokables[ i ]; Index: CountedChainableMethod.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/CountedChainableMethod.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CountedChainableMethod.h 31 Oct 2005 20:50:37 -0000 1.3 +++ CountedChainableMethod.h 13 Nov 2005 11:53:18 -0000 1.4 @@ -47,6 +47,7 @@ #ifndef MOCKPP_COUNTED_WEAKNESS + /** Helper class to select the method mock with the correct number of parameters. * Works with meta programming. * @internal Index: AbstractDynamicChainingMock.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/AbstractDynamicChainingMock.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- AbstractDynamicChainingMock.h 28 Aug 2005 20:40:23 -0000 1.34 +++ AbstractDynamicChainingMock.h 13 Nov 2005 11:53:18 -0000 1.35 @@ -184,7 +184,7 @@ */ virtual void reset() { - invocationDispatcher->clear(); + invocationDispatcher->reset(); forgetFailure(); } |
From: Ewald A. <ewa...@us...> - 2005-11-13 11:52:37
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27506/mockpp Modified Files: gen_visitablemethod_N.pl VisitableMockMethod0.h VisitableMockMethod1.h VisitableMockMethod2.h VisitableMockMethod3.h VisitableMockMethod4.h VisitableMockMethod5.h VisitableMockMethod6.h VisitableMockMethod.cpp VisitableMockMethod.h Log Message: omit Controller class Index: VisitableMockMethod.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- VisitableMockMethod.cpp 29 Oct 2005 21:00:26 -0000 1.4 +++ VisitableMockMethod.cpp 13 Nov 2005 11:52:26 -0000 1.5 @@ -38,28 +38,26 @@ MOCKPP_EXPORT VisitableMockMethodBase::VisitableMockMethodBase(const String &name, - VisitableMockObject *parent) + VisitableMockObject *parent) : MockObject(name, parent) , visitable(parent) , throwables (name + MOCKPP_PCHAR("/throwables"), this) , throwablesInline (true) { - MOCKPP_PRE(parent != 0); - MOCKPP_PRE(name.length() != 0); + MOCKPP_PRE(parent != 0); + MOCKPP_PRE(name.length() != 0); } String MOCKPP_EXPORT VisitableMockMethodBase::getMethodName() const { - static String method_name = getVerifiableName(); // + MOCKPP_PCHAR(".") + m_name; - return method_name; + return getVerifiableName(); // + MOCKPP_PCHAR(".") + m_name; } std::string MOCKPP_EXPORT VisitableMockMethodBase::getMethodIdentifier() const { - static std::string method_id = getLatin1(getMethodName()); - return method_id; + return getLatin1(getMethodName()); } Index: VisitableMockMethod6.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod6.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- VisitableMockMethod6.h 3 Nov 2005 20:50:41 -0000 1.5 +++ VisitableMockMethod6.h 13 Nov 2005 11:52:26 -0000 1.6 @@ -115,7 +115,7 @@ this->getVisitableMockObject()->addActualMethod(this->getMethodIdentifier()); Throwable *t; - if (this->responseValues.find(t, p1, p2, p3, p4, p5, p6)) + if (this->responseThrowables.find(t, p1, p2, p3, p4, p5, p6)) t->throw_me(); this->throwAvailableException(); @@ -144,61 +144,42 @@ public: - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller + + /** Adds another response throwable. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param t the throwable object + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param p4 mock method parameter 4 + * @param p5 mock method parameter 5 + * @param p6 mock method parameter 6 + * @param count the number of times this value shall be returned. Default is unlimited. */ - class ControllerFor : public VisitableMockReturningMethodBase<R>::ControllerFor + void addResponseThrowable(Throwable *t, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, unsigned count = MOCKPP_UNLIMITED) { - public: - - typedef typename VisitableMockReturningMethodBase<R>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - } - - /** Adds another response throwable. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param t the throwable object - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param p4 mock method parameter 4 - * @param p5 mock method parameter 5 - * @param p6 mock method parameter 6 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseThrowable(Throwable *t, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(t, p1, p2, p3, p4, p5, p6, count); - } - - /** Adds another response throwable. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param t the throwable object - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param p4 mock method parameter 4 - * @param p5 mock method parameter 5 - * @param p6 mock method parameter 6 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseThrowable(Throwable *t, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, const ConstraintHolder<P4> &p4, const ConstraintHolder<P5> &p5, const ConstraintHolder<P6> &p6, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(t, p1, p2, p3, p4, p5, p6, count); - } - }; + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseThrowables.add(t, p1, p2, p3, p4, p5, p6, count); + } - friend class ControllerFor; + /** Adds another response throwable. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param t the throwable object + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param p4 mock method parameter 4 + * @param p5 mock method parameter 5 + * @param p6 mock method parameter 6 + * @param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseThrowable(Throwable *t, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, const ConstraintHolder<P4> &p4, const ConstraintHolder<P5> &p5, const ConstraintHolder<P6> &p6, unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseThrowables.add(t, p1, p2, p3, p4, p5, p6, count); + } private: @@ -245,68 +226,47 @@ this->forward_param(p1, p2, p3, p4, p5, p6); R ret_val; - if (this->method->responseValues.find(ret_val, p1, p2, p3, p4, p5, p6)) + if (this->responseValues.find(ret_val, p1, p2, p3, p4, p5, p6)) return ret_val; return this->determineReturnValue(); } - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller + /** Adds another response value. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param rv the return value + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param p4 mock method parameter 4 + * @param p5 mock method parameter 5 + * @param p6 mock method parameter 6 + * @param count the number of times this value shall be returned. Default is unlimited. */ - class ControllerFor : public VisitableMockReturningMethodBase<void>::ControllerFor + void addResponseValue(const R &rv, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, unsigned count = MOCKPP_UNLIMITED) { - public: - - typedef typename VisitableMockReturningMethodBase<R>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - } - - /** Adds another response value. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param rv the return value - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param p4 mock method parameter 4 - * @param p5 mock method parameter 5 - * @param p6 mock method parameter 6 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseValue(const R &rv, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(rv, p1, p2, p3, p4, p5, p6, count); - } - - /** Adds another response value. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param rv the return value - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param p4 mock method parameter 4 - * @param p5 mock method parameter 5 - * @param p6 mock method parameter 6 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseValue(const R &rv, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, const ConstraintHolder<P4> &p4, const ConstraintHolder<P5> &p5, const ConstraintHolder<P6> &p6, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(rv, p1, p2, p3, p4, p5, p6, count); - } - - }; + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseValues.add(rv, p1, p2, p3, p4, p5, p6, count); + } - friend class ControllerFor; + /** Adds another response value. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param rv the return value + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param p4 mock method parameter 4 + * @param p5 mock method parameter 5 + * @param p6 mock method parameter 6 + * @param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseValue(const R &rv, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, const ConstraintHolder<P4> &p4, const ConstraintHolder<P5> &p5, const ConstraintHolder<P6> &p6, unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseValues.add(rv, p1, p2, p3, p4, p5, p6, count); + } private: @@ -345,26 +305,6 @@ { this->forward_param(p1, p2, p3, p4, p5, p6); } - - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller - */ - class ControllerFor : public VisitableMockReturningMethodBase<void>::ControllerFor - { - public: - - typedef VisitableMockReturningMethodBase<void>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<void> *meth) - : Inherited(meth) - { - } - }; - - friend class ControllerFor; }; Index: VisitableMockMethod2.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod2.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- VisitableMockMethod2.h 3 Nov 2005 20:50:41 -0000 1.7 +++ VisitableMockMethod2.h 13 Nov 2005 11:52:26 -0000 1.8 @@ -95,7 +95,7 @@ this->getVisitableMockObject()->addActualMethod(this->getMethodIdentifier()); Throwable *t; - if (this->responseValues.find(t, p1, p2)) + if (this->responseThrowables.find(t, p1, p2)) t->throw_me(); this->throwAvailableException(); @@ -116,53 +116,34 @@ public: - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller + + /** Adds another response throwable. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param t the throwable object + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param count the number of times this value shall be returned. Default is unlimited. */ - class ControllerFor : public VisitableMockReturningMethodBase<R>::ControllerFor + void addResponseThrowable(Throwable *t, const P1 &p1, const P2 &p2, unsigned count = MOCKPP_UNLIMITED) { - public: - - typedef typename VisitableMockReturningMethodBase<R>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - } - - /** Adds another response throwable. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param t the throwable object - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseThrowable(Throwable *t, const P1 &p1, const P2 &p2, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(t, p1, p2, count); - } - - /** Adds another response throwable. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param t the throwable object - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseThrowable(Throwable *t, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(t, p1, p2, count); - } - }; + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseThrowables.add(t, p1, p2, count); + } - friend class ControllerFor; + /** Adds another response throwable. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param t the throwable object + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseThrowable(Throwable *t, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseThrowables.add(t, p1, p2, count); + } private: @@ -201,60 +182,39 @@ this->forward_param(p1, p2); R ret_val; - if (this->method->responseValues.find(ret_val, p1, p2)) + if (this->responseValues.find(ret_val, p1, p2)) return ret_val; return this->determineReturnValue(); } - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller + /** Adds another response value. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param rv the return value + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param count the number of times this value shall be returned. Default is unlimited. */ - class ControllerFor : public VisitableMockReturningMethodBase<void>::ControllerFor + void addResponseValue(const R &rv, const P1 &p1, const P2 &p2, unsigned count = MOCKPP_UNLIMITED) { - public: - - typedef typename VisitableMockReturningMethodBase<R>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - } - - /** Adds another response value. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param rv the return value - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseValue(const R &rv, const P1 &p1, const P2 &p2, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(rv, p1, p2, count); - } - - /** Adds another response value. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param rv the return value - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseValue(const R &rv, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(rv, p1, p2, count); - } - - }; + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseValues.add(rv, p1, p2, count); + } - friend class ControllerFor; + /** Adds another response value. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param rv the return value + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseValue(const R &rv, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseValues.add(rv, p1, p2, count); + } private: @@ -289,26 +249,6 @@ { this->forward_param(p1, p2); } - - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller - */ - class ControllerFor : public VisitableMockReturningMethodBase<void>::ControllerFor - { - public: - - typedef VisitableMockReturningMethodBase<void>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<void> *meth) - : Inherited(meth) - { - } - }; - - friend class ControllerFor; }; Index: gen_visitablemethod_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/gen_visitablemethod_N.pl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- gen_visitablemethod_N.pl 6 Nov 2005 14:25:31 -0000 1.9 +++ gen_visitablemethod_N.pl 13 Nov 2005 11:52:26 -0000 1.10 @@ -246,7 +246,7 @@ this->getVisitableMockObject()->addActualMethod(this->getMethodIdentifier()); Throwable *t; - if (this->responseValues.find(t, " . $args . ")) + if (this->responseThrowables.find(t, " . $args . ")) t->throw_me(); this->throwAvailableException(); @@ -298,67 +298,47 @@ print OUT " public: - - /** Helper object to easily set up the visitable expectations. - * \@ingroup grp_controller - */ - class ControllerFor : public VisitableMockReturningMethodBase<R>::ControllerFor - { - public: - - typedef typename VisitableMockReturningMethodBase<R>::ControllerFor Inherited; - - /** Construct the controller object. - * \@param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - }"; +"; if ($numArgs > 0) { print OUT " - /** Adds another response throwable. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * \@param t the throwable object"; + /** Adds another response throwable. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * \@param t the throwable object"; for($p = 1; $p <= $numArgs; ++$p) { print OUT " - * \@param p" . $p . " mock method parameter " . $p; } + * \@param p" . $p . " mock method parameter " . $p; } print OUT " - * \@param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseThrowable(Throwable *t, " . $parms . ", unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(t, " . $args . ", count); - } + * \@param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseThrowable(Throwable *t, " . $parms . ", unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseThrowables.add(t, " . $args . ", count); + } - /** Adds another response throwable. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * \@param t the throwable object"; + /** Adds another response throwable. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * \@param t the throwable object"; for($p = 1; $p <= $numArgs; ++$p) { print OUT " - * \@param p" . $p . " mock method parameter " . $p; } + * \@param p" . $p . " mock method parameter " . $p; } print OUT " - * \@param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseThrowable(Throwable *t, " . $holderParms . ", unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(t, " . $args . ", count); - }"; + * \@param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseThrowable(Throwable *t, " . $holderParms . ", unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseThrowables.add(t, " . $args . ", count); + }"; } -print OUT " - }; - - friend class ControllerFor;"; if ($numArgs > 0) { @@ -419,7 +399,7 @@ print OUT " R ret_val; - if (this->method->responseValues.find(ret_val, " . $args . ")) + if (this->responseValues.find(ret_val, " . $args . ")) return ret_val; "; } @@ -427,68 +407,46 @@ print OUT " return this->determineReturnValue(); } - - /** Helper object to easily set up the visitable expectations. - * \@ingroup grp_controller - */ - class ControllerFor : public VisitableMockReturningMethodBase<void>::ControllerFor - { - public: - - typedef typename VisitableMockReturningMethodBase<R>::ControllerFor Inherited; - - /** Construct the controller object. - * \@param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - } "; if ($numArgs > 0) { print OUT " - /** Adds another response value. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * \@param rv the return value"; + /** Adds another response value. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * \@param rv the return value"; for($p = 1; $p <= $numArgs; ++$p) { print OUT " - * \@param p" . $p . " mock method parameter " . $p; } + * \@param p" . $p . " mock method parameter " . $p; } print OUT " - * \@param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseValue(const R &rv, " . $parms . ", unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(rv, " . $args . ", count); - } + * \@param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseValue(const R &rv, " . $parms . ", unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseValues.add(rv, " . $args . ", count); + } - /** Adds another response value. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * \@param rv the return value"; + /** Adds another response value. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * \@param rv the return value"; for($p = 1; $p <= $numArgs; ++$p) { print OUT " - * \@param p" . $p . " mock method parameter " . $p; } + * \@param p" . $p . " mock method parameter " . $p; } print OUT " - * \@param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseValue(const R &rv, " . $holderParms . ", unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(rv, " . $args . ", count); - }"; + * \@param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseValue(const R &rv, " . $holderParms . ", unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseValues.add(rv, " . $args . ", count); + }"; } -print OUT " - }; - - friend class ControllerFor;"; - if ($numArgs > 0) { print OUT " @@ -532,26 +490,6 @@ { this->forward_param(" . $args . "); } - - /** Helper object to easily set up the visitable expectations. - * \@ingroup grp_controller - */ - class ControllerFor : public VisitableMockReturningMethodBase<void>::ControllerFor - { - public: - - typedef VisitableMockReturningMethodBase<void>::ControllerFor Inherited; - - /** Construct the controller object. - * \@param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<void> *meth) - : Inherited(meth) - { - } - }; - - friend class ControllerFor; }; Index: VisitableMockMethod3.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod3.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- VisitableMockMethod3.h 3 Nov 2005 20:50:41 -0000 1.7 +++ VisitableMockMethod3.h 13 Nov 2005 11:52:26 -0000 1.8 @@ -100,7 +100,7 @@ this->getVisitableMockObject()->addActualMethod(this->getMethodIdentifier()); Throwable *t; - if (this->responseValues.find(t, p1, p2, p3)) + if (this->responseThrowables.find(t, p1, p2, p3)) t->throw_me(); this->throwAvailableException(); @@ -123,55 +123,36 @@ public: - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller + + /** Adds another response throwable. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param t the throwable object + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param count the number of times this value shall be returned. Default is unlimited. */ - class ControllerFor : public VisitableMockReturningMethodBase<R>::ControllerFor + void addResponseThrowable(Throwable *t, const P1 &p1, const P2 &p2, const P3 &p3, unsigned count = MOCKPP_UNLIMITED) { - public: - - typedef typename VisitableMockReturningMethodBase<R>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - } - - /** Adds another response throwable. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param t the throwable object - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseThrowable(Throwable *t, const P1 &p1, const P2 &p2, const P3 &p3, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(t, p1, p2, p3, count); - } - - /** Adds another response throwable. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param t the throwable object - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseThrowable(Throwable *t, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(t, p1, p2, p3, count); - } - }; + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseThrowables.add(t, p1, p2, p3, count); + } - friend class ControllerFor; + /** Adds another response throwable. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param t the throwable object + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseThrowable(Throwable *t, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseThrowables.add(t, p1, p2, p3, count); + } private: @@ -212,62 +193,41 @@ this->forward_param(p1, p2, p3); R ret_val; - if (this->method->responseValues.find(ret_val, p1, p2, p3)) + if (this->responseValues.find(ret_val, p1, p2, p3)) return ret_val; return this->determineReturnValue(); } - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller + /** Adds another response value. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param rv the return value + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param count the number of times this value shall be returned. Default is unlimited. */ - class ControllerFor : public VisitableMockReturningMethodBase<void>::ControllerFor + void addResponseValue(const R &rv, const P1 &p1, const P2 &p2, const P3 &p3, unsigned count = MOCKPP_UNLIMITED) { - public: - - typedef typename VisitableMockReturningMethodBase<R>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - } - - /** Adds another response value. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param rv the return value - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseValue(const R &rv, const P1 &p1, const P2 &p2, const P3 &p3, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(rv, p1, p2, p3, count); - } - - /** Adds another response value. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param rv the return value - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseValue(const R &rv, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(rv, p1, p2, p3, count); - } - - }; + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseValues.add(rv, p1, p2, p3, count); + } - friend class ControllerFor; + /** Adds another response value. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param rv the return value + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseValue(const R &rv, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseValues.add(rv, p1, p2, p3, count); + } private: @@ -303,26 +263,6 @@ { this->forward_param(p1, p2, p3); } - - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller - */ - class ControllerFor : public VisitableMockReturningMethodBase<void>::ControllerFor - { - public: - - typedef VisitableMockReturningMethodBase<void>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<void> *meth) - : Inherited(meth) - { - } - }; - - friend class ControllerFor; }; Index: VisitableMockMethod.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- VisitableMockMethod.h 8 Nov 2005 18:41:43 -0000 1.16 +++ VisitableMockMethod.h 13 Nov 2005 11:52:26 -0000 1.17 @@ -98,112 +98,79 @@ public: - /** A controller to set up the mock method. + /** Switches exception handling back to pre-1.2 behaviour. + * @see VisitableMockObject::Controller::unsetThrowablesInline() */ - template <class VMM> - class ControllerFor : public VisitableMockObject::Controller + void unsetThrowablesInline() { - public: - - /** Construct the item. - * @param meth pointer to the method mock - */ - ControllerFor (VMM *meth) - : method(meth) - , object(meth->getVisitableMockObject()) - { - this->object->addController(this); - } - - /** Destruct the item. - */ - virtual ~ControllerFor () - { - this->object->removeController(this); - } - - /** Switches exception handling back to pre-1.2 behaviour. - * @see VisitableMockObject::Controller::unsetThrowablesInline() - */ - void unsetThrowablesInline() - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->throwablesInline = false; - }; - - /** Adds another throwable to the method. - * The throwables are thrown one after the other when the method is - * called after activating until all of them are used. - * @param t a pointer to the throwable - */ - void addThrowable(Throwable *t) - { - std::auto_ptr<Throwable> at (t); - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->throwables.push_back(at.release()); - this->method->throwableInsteadReturn.push_back(true); - } - - /** Adds another throwable to the method. - * The throwables are thrown one after the other when the method is - * called after activating until all of them are used. - * @param w the value to throw - * @param count how often to throw the value - */ - template <class T> - void addThrowable(const T &w, unsigned count = 1) - { - for ( ; count > 0; --count) - addThrowable(make_throwable(w)); - } - - /** Sets the default throwable. - * Once the list of throwables is empty this one is thrown. This also - * means that your method never processes the parameters passed to it. - * @param t a pointer to the throwable - */ - void setDefaultThrowable(Throwable *t) - { - std::auto_ptr<Throwable> at (t); - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->defaultThrowable.take(at.release()); - } + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->throwablesInline = false; + }; - /** Clears all expectations and puts the object in record mode again. - */ - virtual void reset() - { - this->method->defaultThrowable.clear(); - this->method->throwables.clear(); - this->method->throwableInsteadReturn.clear(); - this->method->throwablesInline = true; - } + /** Adds another throwable to the method. + * The throwables are thrown one after the other when the method is + * called after activating until all of them are used. + * @param t a pointer to the throwable + */ + void addThrowable(Throwable *t) + { + std::auto_ptr<Throwable> at (t); + MOCKPP_ASSERT_FALSE(getVisitableMockObject()->isActivated()); + this->throwables.push_back(at.release()); + this->throwableInsteadReturn.push_back(true); + } - /** - * Verify the conditions which are not in the verify() chain of the - * visitable mock object. Located here instead of the method for traditional - * reasons. - * If it fails, an AssertionFailedError is thrown - */ - virtual void verify() - { - Throwable *dt = this->method->defaultThrowable.get(); - if (dt != 0) - { - String fmt = mockpp_i18n(MOCKPP_PCHAR("%1 is unused.")); - fmt << (this->method->getMethodName() + MOCKPP_PCHAR("/defaultThrowable")); - MOCKPP_ASSERT_TRUE_MESSAGE(fmt, dt->hasThrown()); - } - } + /** Adds another throwable to the method. + * The throwables are thrown one after the other when the method is + * called after activating until all of them are used. + * @param w the value to throw + * @param count how often to throw the value + */ + template <class T> + void addThrowable(const T &w, unsigned count = 1) + { + for ( ; count > 0; --count) + addThrowable(make_throwable(w)); + } - protected: + /** Sets the default throwable. + * Once the list of throwables is empty this one is thrown. This also + * means that your method never processes the parameters passed to it. + * @param t a pointer to the throwable + */ + void setDefaultThrowable(Throwable *t) + { + std::auto_ptr<Throwable> at (t); + MOCKPP_ASSERT_FALSE(getVisitableMockObject()->isActivated()); + this->defaultThrowable.take(at.release()); + } - VMM *method; - VisitableMockObject *object; - }; + /** Clears all expectations and puts the object in record mode again. + */ + virtual void reset() + { + this->defaultThrowable.reset(); + this->throwables.reset(); + this->throwableInsteadReturn.clear(); + this->throwablesInline = true; + } - template <class VMM> - friend class ControllerFor; + /** + * Verify the conditions which are not in the verify() chain of the + * visitable mock object. Located here instead of the method for traditional + * reasons. + * If it fails, an AssertionFailedError is thrown + */ + virtual void verify() + { + Throwable *dt = this->defaultThrowable.get(); + if (dt != 0) + { + String fmt = mockpp_i18n(MOCKPP_PCHAR("%1 is unused.")); + fmt << (this->getMethodName() + MOCKPP_PCHAR("/defaultThrowable")); + MOCKPP_ASSERT_TRUE_MESSAGE(fmt, dt->hasThrown()); + } + } protected: @@ -234,73 +201,56 @@ , returnValues(getMethodName() + MOCKPP_PCHAR("/returnValues"), this) {} - /** A controller to set up the mock method. + /** Sets the default return value. + * This value is returned if there are no throwables available and if there + * are no other possible return values in a list. + * @param rv the default return value */ - class ControllerFor : public VisitableMockMethodBase::ControllerFor<VisitableMockReturningMethodBase> + void setDefaultReturnValue(const R &rv) { - typedef VisitableMockMethodBase::ControllerFor<VisitableMockReturningMethodBase<R> > Inherited; - - public: - - /** Construct the item. - * @param meth pointer to the method mock - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - } - - /** Sets the default return value. - * This value is returned if there are no throwables available and if there - * are no other possible return values in a list. - * @param rv the default return value - */ - void setDefaultReturnValue(const R &rv) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->haveDefaultReturnValue = true; - this->method->defaultReturnValue = rv; - } + MOCKPP_ASSERT_FALSE(getVisitableMockObject()->isActivated()); + this->haveDefaultReturnValue = true; + this->defaultReturnValue = rv; + } - /** Adds another return value. - * The values from this list are return one after the other unless there - * are no other throwables or response values available. - * @param rv the next return value - * @param count the number of times this value shall be returned - */ - void addReturnValue(const R &rv, unsigned count = 1) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - for ( ; count > 0; --count) - { - this->method->returnValues.addObjectToReturn(rv); - this->method->throwableInsteadReturn.push_back(false); - } - } + /** Adds another return value. + * The values from this list are return one after the other unless there + * are no other throwables or response values available. + * @param rv the next return value + * @param count the number of times this value shall be returned + */ + void addReturnValue(const R &rv, unsigned count = 1) + { + MOCKPP_ASSERT_FALSE(getVisitableMockObject()->isActivated()); + for ( ; count > 0; --count) + { + this->returnValues.addObjectToReturn(rv); + this->throwableInsteadReturn.push_back(false); + } + } - /** Sets all internal objects to the state after construction. - */ - virtual void reset() - { - Inherited::reset(); - this->method->haveDefaultReturnValue = false; - this->method->defaultReturnValueUsed = false; - } + /** Sets all internal objects to the state after construction. + */ + virtual void reset() + { + VisitableMockMethodBase::reset(); + this->haveDefaultReturnValue = false; + this->defaultReturnValueUsed = false; + } - /** Verify that the expected and actual values are equal. - * If it fails, an AssertionFailedError is thrown - */ - virtual void verify() - { - Inherited::verify(); - if (this->method->haveDefaultReturnValue) - { - String fmt = mockpp_i18n(MOCKPP_PCHAR("%1 is unused.")); - fmt << this->method->getMethodName() + MOCKPP_PCHAR("/defaultReturnValueUsed"); - MOCKPP_ASSERT_TRUE_MESSAGE(fmt, this->method->defaultReturnValueUsed); - } - } - }; + /** Verify that the expected and actual values are equal. + * If it fails, an AssertionFailedError is thrown + */ + virtual void verify() + { + VisitableMockMethodBase::verify(); + if (this->haveDefaultReturnValue) + { + String fmt = mockpp_i18n(MOCKPP_PCHAR("%1 is unused.")); + fmt << this->getMethodName() + MOCKPP_PCHAR("/defaultReturnValueUsed"); + MOCKPP_ASSERT_TRUE_MESSAGE(fmt, this->defaultReturnValueUsed); + } + } protected: @@ -308,7 +258,7 @@ * The values from the default value or the list are returned one after * the other. */ - R determineReturnValue() + R determineReturnValue() const { throwableInsteadReturn.erase(throwableInsteadReturn.begin()); if (returnValues.hasMoreObjects()) @@ -319,12 +269,6 @@ return defaultReturnValue; } -#ifdef __BORLANDC__ - friend class ControllerFor; // BCB5 -#else - friend class VisitableMockReturningMethodBase::ControllerFor; -#endif - protected: mutable ReturnObjectList<R> returnValues; @@ -348,29 +292,6 @@ VisitableMockReturningMethodBase(const String &name, VisitableMockObject *parent) : VisitableMockMethodBase(name, parent) {} - - /** A controller to set up the mock method. - */ - class ControllerFor : public VisitableMockMethodBase::ControllerFor<VisitableMockReturningMethodBase<void> > - { - typedef VisitableMockMethodBase::ControllerFor<VisitableMockReturningMethodBase<void> > Inherited; - - public: - - /** Construct the item. - * @param meth pointer to the method mock - */ - ControllerFor (VisitableMockReturningMethodBase<void> *meth) - : Inherited(meth) - { - } - }; - -#ifdef __BORLANDC__ // BCB5 - friend class ControllerFor; -#else - friend class VisitableMockReturningMethodBase<void>::ControllerFor; -#endif }; Index: VisitableMockMethod4.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod4.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- VisitableMockMethod4.h 3 Nov 2005 20:50:41 -0000 1.7 +++ VisitableMockMethod4.h 13 Nov 2005 11:52:26 -0000 1.8 @@ -105,7 +105,7 @@ this->getVisitableMockObject()->addActualMethod(this->getMethodIdentifier()); Throwable *t; - if (this->responseValues.find(t, p1, p2, p3, p4)) + if (this->responseThrowables.find(t, p1, p2, p3, p4)) t->throw_me(); this->throwAvailableException(); @@ -130,57 +130,38 @@ public: - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller + + /** Adds another response throwable. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param t the throwable object + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param p4 mock method parameter 4 + * @param count the number of times this value shall be returned. Default is unlimited. */ - class ControllerFor : public VisitableMockReturningMethodBase<R>::ControllerFor + void addResponseThrowable(Throwable *t, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, unsigned count = MOCKPP_UNLIMITED) { - public: - - typedef typename VisitableMockReturningMethodBase<R>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - } - - /** Adds another response throwable. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param t the throwable object - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param p4 mock method parameter 4 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseThrowable(Throwable *t, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(t, p1, p2, p3, p4, count); - } - - /** Adds another response throwable. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param t the throwable object - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param p4 mock method parameter 4 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseThrowable(Throwable *t, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, const ConstraintHolder<P4> &p4, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(t, p1, p2, p3, p4, count); - } - }; + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseThrowables.add(t, p1, p2, p3, p4, count); + } - friend class ControllerFor; + /** Adds another response throwable. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param t the throwable object + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param p4 mock method parameter 4 + * @param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseThrowable(Throwable *t, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, const ConstraintHolder<P4> &p4, unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseThrowables.add(t, p1, p2, p3, p4, count); + } private: @@ -223,64 +204,43 @@ this->forward_param(p1, p2, p3, p4); R ret_val; - if (this->method->responseValues.find(ret_val, p1, p2, p3, p4)) + if (this->responseValues.find(ret_val, p1, p2, p3, p4)) return ret_val; return this->determineReturnValue(); } - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller + /** Adds another response value. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param rv the return value + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param p4 mock method parameter 4 + * @param count the number of times this value shall be returned. Default is unlimited. */ - class ControllerFor : public VisitableMockReturningMethodBase<void>::ControllerFor + void addResponseValue(const R &rv, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, unsigned count = MOCKPP_UNLIMITED) { - public: - - typedef typename VisitableMockReturningMethodBase<R>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<R> *meth) - : Inherited(meth) - { - } - - /** Adds another response value. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param rv the return value - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param p4 mock method parameter 4 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseValue(const R &rv, const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(rv, p1, p2, p3, p4, count); - } - - /** Adds another response value. - * Response values are determined on the parameters you pass. This way the - * object returns a value that is totally based on the input. - * @param rv the return value - * @param p1 mock method parameter 1 - * @param p2 mock method parameter 2 - * @param p3 mock method parameter 3 - * @param p4 mock method parameter 4 - * @param count the number of times this value shall be returned. Default is unlimited. - */ - void addResponseValue(const R &rv, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, const ConstraintHolder<P4> &p4, unsigned count = MOCKPP_UNLIMITED) - { - MOCKPP_ASSERT_FALSE(this->object->isActivated()); - this->method->responseValues.add(rv, p1, p2, p3, p4, count); - } - - }; + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseValues.add(rv, p1, p2, p3, p4, count); + } - friend class ControllerFor; + /** Adds another response value. + * Response values are determined on the parameters you pass. This way the + * object returns a value that is totally based on the input. + * @param rv the return value + * @param p1 mock method parameter 1 + * @param p2 mock method parameter 2 + * @param p3 mock method parameter 3 + * @param p4 mock method parameter 4 + * @param count the number of times this value shall be returned. Default is unlimited. + */ + void addResponseValue(const R &rv, const ConstraintHolder<P1> &p1, const ConstraintHolder<P2> &p2, const ConstraintHolder<P3> &p3, const ConstraintHolder<P4> &p4, unsigned count = MOCKPP_UNLIMITED) + { + MOCKPP_ASSERT_FALSE(this->getVisitableMockObject()->isActivated()); + this->responseValues.add(rv, p1, p2, p3, p4, count); + } private: @@ -317,26 +277,6 @@ { this->forward_param(p1, p2, p3, p4); } - - /** Helper object to easily set up the visitable expectations. - * @ingroup grp_controller - */ - class ControllerFor : public VisitableMockReturningMethodBase<void>::ControllerFor - { - public: - - typedef VisitableMockReturningMethodBase<void>::ControllerFor Inherited; - - /** Construct the controller object. - * @param meth pointer to according method mock. - */ - ControllerFor (VisitableMockReturningMethodBase<void> *meth) - : Inherited(meth) - { - } - }; - - friend class ControllerFor; }; Index: VisitableMockMethod0.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod0.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- VisitableMockMethod0.h 3 Nov 2005 20:50:41 -0000 1.7 +++ VisitableMockMethod0.h 13 Nov 2005 11:52:26 -0000 1.8 @@ -84,25 +84,6 @@ public: - /*... [truncated message content] |
From: Ewald A. <ewa...@us...> - 2005-11-13 11:52:37
|
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27506/mockpp/tests Modified Files: VisitableMockMethod_2_test.cpp VisitableMockMethod_test.cpp Log Message: omit Controller class Index: VisitableMockMethod_2_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockMethod_2_test.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- VisitableMockMethod_2_test.cpp 15 Oct 2005 15:40:59 -0000 1.3 +++ VisitableMockMethod_2_test.cpp 13 Nov 2005 11:52:26 -0000 1.4 @@ -37,7 +37,7 @@ #else -#include <mockpp/VisitableMockMethod.h> +#include <mockpp/VisitableMockMethod2.h> #include <mockpp/VisitableMockObject.h> #include <mockpp/constraint/OutBound.h> @@ -47,9 +47,6 @@ namespace { // anon -#ifdef MOCKPP_XXX - - class VisitableMockMethod_2_test : public CppUnit::TestFixture { public: @@ -75,43 +72,100 @@ MyVisitableMockObject_2(const mockpp::String &name) : mockpp::VisitableMockObject(name, 0) - , visitable_mocker(MOCKPP_PCHAR("Visitable"), this) + , visitable_mocker(MOCKPP_PCHAR("visitablei2"), this) + , visitablev_mocker(MOCKPP_PCHAR("visitablev2"), this) {} - int visitable(unsigned i) + int visitable(unsigned i, unsigned j) { - return visitable_mocker.forward(i); + return visitable_mocker.forward(i, j); } - mockpp::VisitableMockMethod1<int, unsigned> visitable_mocker; + void visitablev(unsigned i, unsigned j) + { + visitablev_mocker.forward(i, j); + } + + mockpp::VisitableMockMethod2<int, unsigned, unsigned> visitable_mocker; + mockpp::VisitableMockMethod2<void, unsigned, unsigned> visitablev_mocker; }; void VisitableMockMethod_2_test::test_parameter_2() { - MyVisitableMockObject_2 mcm(MOCKPP_PCHAR("Visitable-object")); -/* - mockpp::VisitableMockMethod2<int, unsigned>::ChainerFor chain(mcm, mcm.Visitable_mocker); + MyVisitableMockObject_2 vmo(MOCKPP_PCHAR("Visitable-object")); + mockpp::VisitableMockMethod2<int, unsigned, unsigned> vmb (MOCKPP_PCHAR("methodbase"), &vmo); - MOCKPP_ASSERT_TRUE(mcm.Visitable(12) == 21); - MOCKPP_ASSERT_TRUE(mcm.Visitable(34) == 43); + vmb.setDefaultReturnValue(999); + vmb.addReturnValue(888, 2); + vmo.reset(); - try - { - mcm.Visitable(56); - MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("should have thrown"), false); - } - catch(mockpp::AssertionFailedError &ex) - { - MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("unexpected invocation")) != mockpp::String::npos); - } -*/ - mcm.verify(); + ////////////////79////////////////////////////////////// + + vmb.setDefaultReturnValue(123); + vmb.addReturnValue(321, 2); + vmb.addThrowable(mockpp::make_throwable(123u)); + vmb.forward(1, 2); + vmb.forward(2, 3); + vmb.forward(3, 4); + vmb.forward(4, 5); + vmb.addResponseValue(222, 2, 2); + vmb.addResponseValue(333, 3, 3); + vmb.addResponseThrowable(mockpp::make_throwable(444u), 4, 4); + vmb.addResponseThrowable(mockpp::make_throwable(555u), 5, 5); + vmo.activate(); + + MOCKPP_ASSERT_EQUALS(321, vmb.forward(1, 2)); + MOCKPP_ASSERT_EQUALS(321, vmb.forward(2, 3)); + MOCKPP_ASSERT_EQUALS(123, vmb.forward(3, 4)); + MOCKPP_ASSERT_EQUALS(222, vmb.forward(2, 2)); + MOCKPP_ASSERT_EQUALS(333, vmb.forward(3, 3)); + + MOCKPP_ASSERT_THROWING(vmb.forward(9, 9), + MOCKPP_PCHAR("vmb.forward()-1"), + unsigned, + unsigned(123)); + + MOCKPP_ASSERT_THROWING(vmb.forward(4, 4), + MOCKPP_PCHAR("vmb.forward()-2"), + unsigned, + unsigned(444)); + + MOCKPP_ASSERT_THROWING(vmb.forward(5, 5), + MOCKPP_PCHAR("vmb.forward()-3"), + unsigned, + unsigned(555)); + + vmo.verify(); + vmb.verify(); + + ////////////////////////////////////////////////////// + + vmo.reset(); + vmb.unsetThrowablesInline(); + + vmb.setDefaultReturnValue(123); + vmb.addReturnValue(321, 2); + vmb.addThrowable(mockpp::make_throwable(123u)); + vmo.activate(); + + MOCKPP_ASSERT_THROWING(vmb.forward(9, 9), + MOCKPP_PCHAR("vmb.forward()-2"), + unsigned, + unsigned(123)); + + MOCKPP_ASSERT_EQUALS(321, vmb.forward(1, 2)); + MOCKPP_ASSERT_EQUALS(321, vmb.forward(2, 3)); + MOCKPP_ASSERT_EQUALS(123, vmb.forward(3, 4)); + + vmo.verify(); + vmb.verify(); + vmb.verify(); } -#endif } // anon ns #endif // HAVE_CPPUNIT + Index: VisitableMockMethod_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockMethod_test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- VisitableMockMethod_test.cpp 8 Nov 2005 18:39:51 -0000 1.11 +++ VisitableMockMethod_test.cpp 13 Nov 2005 11:52:26 -0000 1.12 @@ -106,7 +106,7 @@ { return visitable_mocker.forward(); } - +i void visitablev() { visitablev_mocker.forward(); @@ -194,21 +194,21 @@ { mockpp::VisitableMockObject vmo (MOCKPP_PCHAR("mockobj"), 0); MyVisitableMockMethodBase vmb (MOCKPP_PCHAR("methodbase"), &vmo); + MOCKPP_ASSERT_TRUE(vmb.getMethodName() == MOCKPP_PCHAR("methodbase")); MOCKPP_ASSERT_TRUE(vmb.getMethodIdentifier() == "methodbase"); MOCKPP_ASSERT_TRUE(vmb.getVisitableMockObject() == &vmo); - mockpp::VisitableMockMethodBase::ControllerFor<mockpp::VisitableMockMethodBase> ctr(&vmb); - ctr.addThrowable(mockpp::make_throwable(123u)); - ctr.addThrowable(123u); - ctr.setDefaultThrowable(mockpp::make_throwable(321u)); + vmb.addThrowable(mockpp::make_throwable(123u)); + vmb.addThrowable(123u); + vmb.setDefaultThrowable(mockpp::make_throwable(321u)); vmo.activate(); vmo.reset(); - ctr.addThrowable(mockpp::make_throwable(123u)); - ctr.addThrowable(333u, 2); - ctr.setDefaultThrowable(mockpp::make_throwable(321u)); + vmb.addThrowable(mockpp::make_throwable(123u)); + vmb.addThrowable(333u, 2); + vmb.setDefaultThrowable(mockpp::make_throwable(321u)); vmo.activate(); MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), @@ -237,13 +237,13 @@ unsigned(321)); vmo.verify(); - ctr.verify(); + vmb.verify(); vmo.reset(); vmo.verify(); - ctr.verify(); + vmb.verify(); - ctr.setDefaultThrowable(mockpp::make_throwable(321u)); + vmb.setDefaultThrowable(mockpp::make_throwable(321u)); vmo.activate(); MOCKPP_ASSERT_THROWING_COND(vmo.verify(), MOCKPP_PCHAR("vmo.verify()"), @@ -269,18 +269,17 @@ void VisitableMockMethod_test::test_base_returning() { mockpp::VisitableMockObject vmo (MOCKPP_PCHAR("mockobj"), 0); - MyVisitableMockReturningMethodBase<int> vmb (MOCKPP_PCHAR("methodbase"), &vmo); - MyVisitableMockReturningMethodBase<int>::ControllerFor ctr(&vmb); + MyVisitableMockReturningMethodBase<int> vmb (MOCKPP_PCHAR("methodbase-2"), &vmo); - ctr.setDefaultReturnValue(123); - ctr.addReturnValue(321,2); - vmo.clear(); + vmb.setDefaultReturnValue(123); + vmb.addReturnValue(321,2); + vmo.reset(); ////////////////////////////////////////////////////// - ctr.setDefaultReturnValue(123); - ctr.addReturnValue(321, 2); - ctr.addThrowable(mockpp::make_throwable(123u)); + vmb.setDefaultReturnValue(123); + vmb.addReturnValue(321, 2); + vmb.addThrowable(mockpp::make_throwable(123u)); vmo.activate(); MOCKPP_ASSERT_EQUALS(321, vmb.determineReturnValue()); @@ -292,16 +291,16 @@ unsigned, unsigned(123)); vmo.verify(); - ctr.verify(); + vmb.verify(); ////////////////////////////////////////////////////// - vmo.clear(); - ctr.unsetThrowablesInline(); + vmo.reset(); + vmb.unsetThrowablesInline(); - ctr.setDefaultReturnValue(123); - ctr.addReturnValue(321, 2); - ctr.addThrowable(mockpp::make_throwable(123u)); + vmb.setDefaultReturnValue(123); + vmb.addReturnValue(321, 2); + vmb.addThrowable(mockpp::make_throwable(123u)); vmo.activate(); MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), @@ -314,12 +313,12 @@ MOCKPP_ASSERT_EQUALS(123, vmb.determineReturnValue()); vmo.verify(); - ctr.verify(); + vmb.verify(); ////////////////////////////////////////////////////// - vmo.clear(); - ctr.setDefaultReturnValue(123); + vmo.reset(); + vmb.setDefaultReturnValue(123); MOCKPP_ASSERT_THROWING_COND(vmo.verify(), MOCKPP_PCHAR("vmo.verify()"), mockpp::AssertionFailedError, |
From: Ewald A. <ewa...@us...> - 2005-11-08 18:41:53
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26541/mockpp Modified Files: VisitableMockMethod.h Log Message: fix "inline" Index: VisitableMockMethod.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- VisitableMockMethod.h 6 Nov 2005 14:12:07 -0000 1.15 +++ VisitableMockMethod.h 8 Nov 2005 18:41:43 -0000 1.16 @@ -40,6 +40,8 @@ namespace mockpp { +/** Base of all mock methods. + */ class VisitableMockMethodBase : public MockObject { public: @@ -80,22 +82,22 @@ throwableInsteadReturn.erase(throwableInsteadReturn.begin()); } } - + if (do_throw && throwables.hasMoreObjects() != 0) { Throwable *thr = throwables.nextThrowableObject(); if (thr != 0) thr->throw_me(); } - + if (defaultThrowable.get() != 0) defaultThrowable.get()->throw_me(); } - + //------------------------------------------------------------- public: - + /** A controller to set up the mock method. */ template <class VMM> @@ -178,8 +180,8 @@ } /** - * Verify the conditions which are not in the verify() chain of the - * visitable mock object. Located here instead of the method for traditional + * Verify the conditions which are not in the verify() chain of the + * visitable mock object. Located here instead of the method for traditional * reasons. * If it fails, an AssertionFailedError is thrown */ @@ -203,7 +205,7 @@ template <class VMM> friend class ControllerFor; - private: + protected: VisitableMockObject *visitable; mutable ThrowableItem defaultThrowable; @@ -216,6 +218,8 @@ ////////////////////////////////////////////////////////////////////////////////////////////// +/** Base of all mock methods returning some value. + */ template <typename R> class VisitableMockReturningMethodBase : public VisitableMockMethodBase { @@ -274,20 +278,6 @@ } } - /** Determines the current return value. - * The values from the default value or the list are returned one after - * the other. - */ - R determineReturnValue() - { - if (this->method->returnValues.hasMoreObjects()) - return this->method->returnValues.nextReturnObject(); - - MOCKPP_ASSERT_TRUE(this->method->haveDefaultReturnValue == true); - this->method->defaultReturnValueUsed = true; - return this->method->defaultReturnValue; - } - /** Sets all internal objects to the state after construction. */ virtual void reset() @@ -310,10 +300,26 @@ MOCKPP_ASSERT_TRUE_MESSAGE(fmt, this->method->defaultReturnValueUsed); } } - }; -#ifdef __BORLANDC__ + protected: + + /** Determines the current return value. + * The values from the default value or the list are returned one after + * the other. + */ + R determineReturnValue() + { + throwableInsteadReturn.erase(throwableInsteadReturn.begin()); + if (returnValues.hasMoreObjects()) + return returnValues.nextReturnObject(); + + MOCKPP_ASSERT_TRUE(haveDefaultReturnValue == true); + defaultReturnValueUsed = true; + return defaultReturnValue; + } + +#ifdef __BORLANDC__ friend class ControllerFor; // BCB5 #else friend class VisitableMockReturningMethodBase::ControllerFor; @@ -328,6 +334,8 @@ }; +/** Base of all mock methods returning void. + */ template <> class VisitableMockReturningMethodBase<void> : public VisitableMockMethodBase { @@ -358,7 +366,7 @@ } }; -#ifdef __BORLANDC__ // BCB5 +#ifdef __BORLANDC__ // BCB5 friend class ControllerFor; #else friend class VisitableMockReturningMethodBase<void>::ControllerFor; |
From: Ewald A. <ewa...@us...> - 2005-11-08 18:40:01
|
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26000/mockpp/tests Modified Files: VisitableMockMethod_test.cpp Log Message: more tests Index: VisitableMockMethod_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockMethod_test.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- VisitableMockMethod_test.cpp 6 Nov 2005 14:11:24 -0000 1.10 +++ VisitableMockMethod_test.cpp 8 Nov 2005 18:39:51 -0000 1.11 @@ -73,7 +73,7 @@ // CPPUNIT_TEST( test_parameter_0V ); CPPUNIT_TEST( test_base ); CPPUNIT_TEST( test_inst ); - CPPUNIT_TEST( test_base_R ); + CPPUNIT_TEST( test_base_returning ); CPPUNIT_TEST_SUITE_END(); @@ -81,7 +81,7 @@ void test_base(); void test_inst(); - void test_base_R(); + void test_base_returning(); // void test_parameter_0(); // void test_parameter_0V(); }; @@ -152,13 +152,13 @@ mockpp::VisitableMockMethod5<void, int, int, int, int, int> mmv5(MOCKPP_PCHAR("mm5"), 0); mockpp::VisitableMockMethod6<void, int, int, int, int, int, int> mmv6(MOCKPP_PCHAR("mm6"), 0); - mockpp::VisitableMockMethod0<int> mmi0(MOCKPP_PCHAR("mm0"), 0); - mockpp::VisitableMockMethod1<int, int> mmi1(MOCKPP_PCHAR("mm1"), 0); - mockpp::VisitableMockMethod2<int, int, int> mmi2(MOCKPP_PCHAR("mm2"), 0); - mockpp::VisitableMockMethod3<int, int, int, int> mmi3(MOCKPP_PCHAR("mm3"), 0); - mockpp::VisitableMockMethod4<int, int, int, int, int> mmi4(MOCKPP_PCHAR("mm4"), 0); - mockpp::VisitableMockMethod5<int, int, int, int, int, int> mmi5(MOCKPP_PCHAR("mm5"), 0); - mockpp::VisitableMockMethod6<int, int, int, int, int, int, int> mmi6(MOCKPP_PCHAR("mm6"), 0); + mockpp::VisitableMockMethod0<int> mmi0(MOCKPP_PCHAR("mm0"), 0); + mockpp::VisitableMockMethod1<int, int> mmi1(MOCKPP_PCHAR("mm1"), 0); + mockpp::VisitableMockMethod2<int, int, int> mmi2(MOCKPP_PCHAR("mm2"), 0); + mockpp::VisitableMockMethod3<int, int, int, int> mmi3(MOCKPP_PCHAR("mm3"), 0); + mockpp::VisitableMockMethod4<int, int, int, int, int> mmi4(MOCKPP_PCHAR("mm4"), 0); + mockpp::VisitableMockMethod5<int, int, int, int, int, int> mmi5(MOCKPP_PCHAR("mm5"), 0); + mockpp::VisitableMockMethod6<int, int, int, int, int, int, int> mmi6(MOCKPP_PCHAR("mm6"), 0); mockpp::VisitableMockMethod<void> mmvd0(MOCKPP_PCHAR("mm0"), 0); mockpp::VisitableMockMethod<void, int> mmvd1(MOCKPP_PCHAR("mm1"), 0); @@ -168,13 +168,13 @@ mockpp::VisitableMockMethod<void, int, int, int, int, int> mmvd5(MOCKPP_PCHAR("mm5"), 0); mockpp::VisitableMockMethod<void, int, int, int, int, int, int> mmvd6(MOCKPP_PCHAR("mm6"), 0); - mockpp::VisitableMockMethod<int> mmid0(MOCKPP_PCHAR("mm0"), 0); - mockpp::VisitableMockMethod<int, int> mmid1(MOCKPP_PCHAR("mm1"), 0); - mockpp::VisitableMockMethod<int, int, int> mmid2(MOCKPP_PCHAR("mm2"), 0); - mockpp::VisitableMockMethod<int, int, int, int> mmid3(MOCKPP_PCHAR("mm3"), 0); - mockpp::VisitableMockMethod<int, int, int, int, int> mmid4(MOCKPP_PCHAR("mm4"), 0); - mockpp::VisitableMockMethod<int, int, int, int, int, int> mmid5(MOCKPP_PCHAR("mm5"), 0); - mockpp::VisitableMockMethod<int, int, int, int, int, int, int> mmid6(MOCKPP_PCHAR("mm6"), 0); + mockpp::VisitableMockMethod<int> mmid0(MOCKPP_PCHAR("mm0"), 0); + mockpp::VisitableMockMethod<int, int> mmid1(MOCKPP_PCHAR("mm1"), 0); + mockpp::VisitableMockMethod<int, int, int> mmid2(MOCKPP_PCHAR("mm2"), 0); + mockpp::VisitableMockMethod<int, int, int, int> mmid3(MOCKPP_PCHAR("mm3"), 0); + mockpp::VisitableMockMethod<int, int, int, int, int> mmid4(MOCKPP_PCHAR("mm4"), 0); + mockpp::VisitableMockMethod<int, int, int, int, int, int> mmid5(MOCKPP_PCHAR("mm5"), 0); + mockpp::VisitableMockMethod<int, int, int, int, int, int, int> mmid6(MOCKPP_PCHAR("mm6"), 0); } @@ -185,7 +185,7 @@ MyVisitableMockMethodBase(const mockpp::String &name, mockpp::VisitableMockObject *parent) : mockpp::VisitableMockMethodBase(name, parent) {} - + using mockpp::VisitableMockMethodBase::throwAvailableException; }; @@ -205,12 +205,12 @@ vmo.activate(); vmo.reset(); - + ctr.addThrowable(mockpp::make_throwable(123u)); ctr.addThrowable(333u, 2); ctr.setDefaultThrowable(mockpp::make_throwable(321u)); vmo.activate(); - + MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), MOCKPP_PCHAR("vmb.throwAvailableException()"), unsigned, @@ -238,7 +238,7 @@ vmo.verify(); ctr.verify(); - + vmo.reset(); vmo.verify(); ctr.verify(); @@ -248,18 +248,82 @@ MOCKPP_ASSERT_THROWING_COND(vmo.verify(), MOCKPP_PCHAR("vmo.verify()"), mockpp::AssertionFailedError, - exception_object.getMessage().find(MOCKPP_PCHAR("is unused")) != mockpp::String::npos); + exception_object.getMessage().find(MOCKPP_PCHAR("/defaultThrowable is unused")) != mockpp::String::npos); } -void VisitableMockMethod_test::test_base_R() +template <class T> +class MyVisitableMockReturningMethodBase : public mockpp::VisitableMockReturningMethodBase<T> +{ + public: + + MyVisitableMockReturningMethodBase(const mockpp::String &name, mockpp::VisitableMockObject *parent) + : mockpp::VisitableMockReturningMethodBase<T>(name, parent) + {} + + using mockpp::VisitableMockReturningMethodBase<T>::throwAvailableException; + using mockpp::VisitableMockReturningMethodBase<T>::determineReturnValue; +}; + + +void VisitableMockMethod_test::test_base_returning() { mockpp::VisitableMockObject vmo (MOCKPP_PCHAR("mockobj"), 0); - mockpp::VisitableMockMethodBase vmb (MOCKPP_PCHAR("methodbase"), &vmo); - mockpp::VisitableMockMethodBase::ControllerFor<mockpp::VisitableMockMethodBase> ctr(&vmb); - - ctr.unsetThrowablesInline(); + MyVisitableMockReturningMethodBase<int> vmb (MOCKPP_PCHAR("methodbase"), &vmo); + MyVisitableMockReturningMethodBase<int>::ControllerFor ctr(&vmb); + + ctr.setDefaultReturnValue(123); + ctr.addReturnValue(321,2); + vmo.clear(); + + ////////////////////////////////////////////////////// + + ctr.setDefaultReturnValue(123); + ctr.addReturnValue(321, 2); + ctr.addThrowable(mockpp::make_throwable(123u)); + vmo.activate(); + + MOCKPP_ASSERT_EQUALS(321, vmb.determineReturnValue()); + MOCKPP_ASSERT_EQUALS(321, vmb.determineReturnValue()); + MOCKPP_ASSERT_EQUALS(123, vmb.determineReturnValue()); + + MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), + MOCKPP_PCHAR("vmb.throwAvailableException()-1"), + unsigned, + unsigned(123)); + vmo.verify(); + ctr.verify(); + + ////////////////////////////////////////////////////// + + vmo.clear(); + ctr.unsetThrowablesInline(); + ctr.setDefaultReturnValue(123); + ctr.addReturnValue(321, 2); + ctr.addThrowable(mockpp::make_throwable(123u)); + vmo.activate(); + + MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), + MOCKPP_PCHAR("vmb.throwAvailableException()-2"), + unsigned, + unsigned(123)); + + MOCKPP_ASSERT_EQUALS(321, vmb.determineReturnValue()); + MOCKPP_ASSERT_EQUALS(321, vmb.determineReturnValue()); + MOCKPP_ASSERT_EQUALS(123, vmb.determineReturnValue()); + + vmo.verify(); + ctr.verify(); + + ////////////////////////////////////////////////////// + + vmo.clear(); + ctr.setDefaultReturnValue(123); + MOCKPP_ASSERT_THROWING_COND(vmo.verify(), + MOCKPP_PCHAR("vmo.verify()"), + mockpp::AssertionFailedError, + exception_object.getMessage().find(MOCKPP_PCHAR("/defaultReturnValueUsed is unused")) != mockpp::String::npos); } |
From: Ewald A. <ewa...@us...> - 2005-11-06 14:25:47
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6131/mockpp Modified Files: gen_visitablemethod_N.pl Log Message: optical fix Index: gen_visitablemethod_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/gen_visitablemethod_N.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- gen_visitablemethod_N.pl 3 Nov 2005 20:51:20 -0000 1.8 +++ gen_visitablemethod_N.pl 6 Nov 2005 14:25:31 -0000 1.9 @@ -481,8 +481,7 @@ { MOCKPP_ASSERT_FALSE(this->object->isActivated()); this->method->responseValues.add(rv, " . $args . ", count); - } -"; + }"; } print OUT " |
From: Ewald A. <ewa...@us...> - 2005-11-06 14:12:17
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3801/mockpp Modified Files: VisitableMockMethod.h Log Message: missing docs Index: VisitableMockMethod.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- VisitableMockMethod.h 31 Oct 2005 19:01:00 -0000 1.14 +++ VisitableMockMethod.h 6 Nov 2005 14:12:07 -0000 1.15 @@ -50,14 +50,25 @@ */ VisitableMockMethodBase(const String &name, VisitableMockObject *parent); + /** Gets the name of the associated method. + * @return method name + */ String getMethodName() const; + /** Gets the method identifier. + * @return method identifier + */ std::string getMethodIdentifier() const; + /** Gets the parent mock object. + * @return pointer to mock object + */ VisitableMockObject *getVisitableMockObject() const; protected: + /** Throws an exception if available. + */ void throwAvailableException() const { bool do_throw = true; @@ -85,6 +96,8 @@ public: + /** A controller to set up the mock method. + */ template <class VMM> class ControllerFor : public VisitableMockObject::Controller { @@ -154,7 +167,6 @@ this->method->defaultThrowable.take(at.release()); } - /** Clears all expectations and puts the object in record mode again. */ virtual void reset() @@ -218,6 +230,8 @@ , returnValues(getMethodName() + MOCKPP_PCHAR("/returnValues"), this) {} + /** A controller to set up the mock method. + */ class ControllerFor : public VisitableMockMethodBase::ControllerFor<VisitableMockReturningMethodBase> { typedef VisitableMockMethodBase::ControllerFor<VisitableMockReturningMethodBase<R> > Inherited; @@ -327,8 +341,7 @@ : VisitableMockMethodBase(name, parent) {} - /** Construct the item. - * @param meth pointer to the method mock + /** A controller to set up the mock method. */ class ControllerFor : public VisitableMockMethodBase::ControllerFor<VisitableMockReturningMethodBase<void> > { @@ -336,6 +349,9 @@ public: + /** Construct the item. + * @param meth pointer to the method mock + */ ControllerFor (VisitableMockReturningMethodBase<void> *meth) : Inherited(meth) { |
From: Ewald A. <ewa...@us...> - 2005-11-06 14:11:33
|
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3673/mockpp/tests Modified Files: VisitableMockMethod_test.cpp Log Message: more tests Index: VisitableMockMethod_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockMethod_test.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- VisitableMockMethod_test.cpp 31 Oct 2005 19:01:00 -0000 1.9 +++ VisitableMockMethod_test.cpp 6 Nov 2005 14:11:24 -0000 1.10 @@ -73,6 +73,7 @@ // CPPUNIT_TEST( test_parameter_0V ); CPPUNIT_TEST( test_base ); CPPUNIT_TEST( test_inst ); + CPPUNIT_TEST( test_base_R ); CPPUNIT_TEST_SUITE_END(); @@ -80,6 +81,7 @@ void test_base(); void test_inst(); + void test_base_R(); // void test_parameter_0(); // void test_parameter_0V(); }; @@ -176,22 +178,88 @@ } +class MyVisitableMockMethodBase : public mockpp::VisitableMockMethodBase +{ + public: + + MyVisitableMockMethodBase(const mockpp::String &name, mockpp::VisitableMockObject *parent) + : mockpp::VisitableMockMethodBase(name, parent) + {} + + using mockpp::VisitableMockMethodBase::throwAvailableException; +}; + + void VisitableMockMethod_test::test_base() { mockpp::VisitableMockObject vmo (MOCKPP_PCHAR("mockobj"), 0); - mockpp::VisitableMockMethodBase vmb (MOCKPP_PCHAR("methodbase"), &vmo); + MyVisitableMockMethodBase vmb (MOCKPP_PCHAR("methodbase"), &vmo); MOCKPP_ASSERT_TRUE(vmb.getMethodName() == MOCKPP_PCHAR("methodbase")); + MOCKPP_ASSERT_TRUE(vmb.getMethodIdentifier() == "methodbase"); MOCKPP_ASSERT_TRUE(vmb.getVisitableMockObject() == &vmo); mockpp::VisitableMockMethodBase::ControllerFor<mockpp::VisitableMockMethodBase> ctr(&vmb); - ctr.unsetThrowablesInline(); ctr.addThrowable(mockpp::make_throwable(123u)); ctr.addThrowable(123u); ctr.setDefaultThrowable(mockpp::make_throwable(321u)); -// ctr.verify(); + vmo.activate(); + vmo.reset(); + + ctr.addThrowable(mockpp::make_throwable(123u)); + ctr.addThrowable(333u, 2); + ctr.setDefaultThrowable(mockpp::make_throwable(321u)); + vmo.activate(); + + MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), + MOCKPP_PCHAR("vmb.throwAvailableException()"), + unsigned, + unsigned(123)); + + MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), + MOCKPP_PCHAR("vmb.throwAvailableException()"), + unsigned, + unsigned(333)); + + MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), + MOCKPP_PCHAR("vmb.throwAvailableException()"), + unsigned, + unsigned(333)); + + MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), + MOCKPP_PCHAR("vmb.throwAvailableException()"), + unsigned, + unsigned(321)); + + MOCKPP_ASSERT_THROWING(vmb.throwAvailableException(), + MOCKPP_PCHAR("vmb.throwAvailableException()"), + unsigned, + unsigned(321)); + + vmo.verify(); + ctr.verify(); + + vmo.reset(); + vmo.verify(); + ctr.verify(); + + ctr.setDefaultThrowable(mockpp::make_throwable(321u)); + vmo.activate(); + MOCKPP_ASSERT_THROWING_COND(vmo.verify(), + MOCKPP_PCHAR("vmo.verify()"), + mockpp::AssertionFailedError, + exception_object.getMessage().find(MOCKPP_PCHAR("is unused")) != mockpp::String::npos); +} + + +void VisitableMockMethod_test::test_base_R() +{ + mockpp::VisitableMockObject vmo (MOCKPP_PCHAR("mockobj"), 0); + mockpp::VisitableMockMethodBase vmb (MOCKPP_PCHAR("methodbase"), &vmo); + mockpp::VisitableMockMethodBase::ControllerFor<mockpp::VisitableMockMethodBase> ctr(&vmb); + + ctr.unsetThrowablesInline(); - ctr.reset(); } |
From: Ewald A. <ewa...@us...> - 2005-11-03 20:51:27
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17827/mockpp Modified Files: gen_visitablemethod_N.pl Log Message: missing file Index: gen_visitablemethod_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/gen_visitablemethod_N.pl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- gen_visitablemethod_N.pl 29 Oct 2005 19:09:26 -0000 1.7 +++ gen_visitablemethod_N.pl 3 Nov 2005 20:51:20 -0000 1.8 @@ -220,7 +220,7 @@ if ($numArgs > 0) { print OUT " - /** Perform the internals to verify a mocked method."; + /** Perform the internals to verify a mocked method or setup expectations."; for($p = 1; $p <= $numArgs; ++$p) { print OUT " * \@param p" . $p . " mock method parameter " . $p; } @@ -443,7 +443,8 @@ ControllerFor (VisitableMockReturningMethodBase<R> *meth) : Inherited(meth) { - }"; + } +"; if ($numArgs > 0) { |
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17702/mockpp Modified Files: VisitableMockMethod0.h VisitableMockMethod1.h VisitableMockMethod2.h VisitableMockMethod3.h VisitableMockMethod4.h VisitableMockMethod5.h VisitableMockMethod6.h Log Message: docs Index: VisitableMockMethod6.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod6.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- VisitableMockMethod6.h 31 Oct 2005 19:01:00 -0000 1.4 +++ VisitableMockMethod6.h 3 Nov 2005 20:50:41 -0000 1.5 @@ -87,7 +87,7 @@ protected: - /** Perform the internals to verify a mocked method. + /** Perform the internals to verify a mocked method or setup expectations. * @param p1 mock method parameter 1 * @param p2 mock method parameter 2 * @param p3 mock method parameter 3 @@ -267,6 +267,7 @@ : Inherited(meth) { } + /** Adds another response value. * Response values are determined on the parameters you pass. This way the * object returns a value that is totally based on the input. Index: VisitableMockMethod2.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod2.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- VisitableMockMethod2.h 31 Oct 2005 19:01:00 -0000 1.6 +++ VisitableMockMethod2.h 3 Nov 2005 20:50:41 -0000 1.7 @@ -75,7 +75,7 @@ protected: - /** Perform the internals to verify a mocked method. + /** Perform the internals to verify a mocked method or setup expectations. * @param p1 mock method parameter 1 * @param p2 mock method parameter 2 */ @@ -223,6 +223,7 @@ : Inherited(meth) { } + /** Adds another response value. * Response values are determined on the parameters you pass. This way the * object returns a value that is totally based on the input. Index: VisitableMockMethod3.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod3.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- VisitableMockMethod3.h 31 Oct 2005 19:01:00 -0000 1.6 +++ VisitableMockMethod3.h 3 Nov 2005 20:50:41 -0000 1.7 @@ -78,7 +78,7 @@ protected: - /** Perform the internals to verify a mocked method. + /** Perform the internals to verify a mocked method or setup expectations. * @param p1 mock method parameter 1 * @param p2 mock method parameter 2 * @param p3 mock method parameter 3 @@ -234,6 +234,7 @@ : Inherited(meth) { } + /** Adds another response value. * Response values are determined on the parameters you pass. This way the * object returns a value that is totally based on the input. Index: VisitableMockMethod4.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod4.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- VisitableMockMethod4.h 31 Oct 2005 19:01:00 -0000 1.6 +++ VisitableMockMethod4.h 3 Nov 2005 20:50:41 -0000 1.7 @@ -81,7 +81,7 @@ protected: - /** Perform the internals to verify a mocked method. + /** Perform the internals to verify a mocked method or setup expectations. * @param p1 mock method parameter 1 * @param p2 mock method parameter 2 * @param p3 mock method parameter 3 @@ -245,6 +245,7 @@ : Inherited(meth) { } + /** Adds another response value. * Response values are determined on the parameters you pass. This way the * object returns a value that is totally based on the input. Index: VisitableMockMethod0.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod0.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- VisitableMockMethod0.h 31 Oct 2005 19:01:00 -0000 1.6 +++ VisitableMockMethod0.h 3 Nov 2005 20:50:41 -0000 1.7 @@ -148,6 +148,7 @@ : Inherited(meth) { } + }; friend class ControllerFor; Index: VisitableMockMethod5.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod5.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- VisitableMockMethod5.h 31 Oct 2005 19:01:00 -0000 1.6 +++ VisitableMockMethod5.h 3 Nov 2005 20:50:41 -0000 1.7 @@ -84,7 +84,7 @@ protected: - /** Perform the internals to verify a mocked method. + /** Perform the internals to verify a mocked method or setup expectations. * @param p1 mock method parameter 1 * @param p2 mock method parameter 2 * @param p3 mock method parameter 3 @@ -256,6 +256,7 @@ : Inherited(meth) { } + /** Adds another response value. * Response values are determined on the parameters you pass. This way the * object returns a value that is totally based on the input. Index: VisitableMockMethod1.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod1.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- VisitableMockMethod1.h 31 Oct 2005 19:01:00 -0000 1.6 +++ VisitableMockMethod1.h 3 Nov 2005 20:50:41 -0000 1.7 @@ -72,7 +72,7 @@ protected: - /** Perform the internals to verify a mocked method. + /** Perform the internals to verify a mocked method or setup expectations. * @param p1 mock method parameter 1 */ void forward_param(const P1 &p1) const @@ -212,6 +212,7 @@ : Inherited(meth) { } + /** Adds another response value. * Response values are determined on the parameters you pass. This way the * object returns a value that is totally based on the input. |
From: Ewald A. <ewa...@us...> - 2005-11-03 20:44:24
|
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16033/mockpp/tests Modified Files: ChainableMockMethod_1_test.cpp ChainableMockMethod_2_test.cpp ChainableMockMethod_test.cpp Log Message: completed tests Index: ChainableMockMethod_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockMethod_test.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ChainableMockMethod_test.cpp 31 Oct 2005 19:24:10 -0000 1.10 +++ ChainableMockMethod_test.cpp 3 Nov 2005 20:44:06 -0000 1.11 @@ -37,8 +37,6 @@ #else -//#define MOCKPP_COUNTED_WEAKNESS // only BCB5 - #include <mockpp/chaining/ChainableMockMethod.h> #include <mockpp/chaining/ChainableMockMethod0.h> #include <mockpp/chaining/ChainableMockMethod1.h> @@ -123,12 +121,12 @@ mockpp::ChainableMockMethod5<void, int, int, int, int, int> mmv5(MOCKPP_PCHAR("mm5"), 0); mockpp::ChainableMockMethod6<void, int, int, int, int, int, int> mmv6(MOCKPP_PCHAR("mm6"), 0); - mockpp::ChainableMockMethod0<int> mmi0(MOCKPP_PCHAR("mm0"), 0); - mockpp::ChainableMockMethod1<int, int> mmi1(MOCKPP_PCHAR("mm1"), 0); - mockpp::ChainableMockMethod2<int, int, int> mmi2(MOCKPP_PCHAR("mm2"), 0); - mockpp::ChainableMockMethod3<int, int, int, int> mmi3(MOCKPP_PCHAR("mm3"), 0); - mockpp::ChainableMockMethod4<int, int, int, int, int> mmi4(MOCKPP_PCHAR("mm4"), 0); - mockpp::ChainableMockMethod5<int, int, int, int, int, int> mmi5(MOCKPP_PCHAR("mm5"), 0); + mockpp::ChainableMockMethod0<int> mmi0(MOCKPP_PCHAR("mm0"), 0); + mockpp::ChainableMockMethod1<int, int> mmi1(MOCKPP_PCHAR("mm1"), 0); + mockpp::ChainableMockMethod2<int, int, int> mmi2(MOCKPP_PCHAR("mm2"), 0); + mockpp::ChainableMockMethod3<int, int, int, int> mmi3(MOCKPP_PCHAR("mm3"), 0); + mockpp::ChainableMockMethod4<int, int, int, int, int> mmi4(MOCKPP_PCHAR("mm4"), 0); + mockpp::ChainableMockMethod5<int, int, int, int, int, int> mmi5(MOCKPP_PCHAR("mm5"), 0); mockpp::ChainableMockMethod6<int, int, int, int, int, int, int> mmi6(MOCKPP_PCHAR("mm6"), 0); mockpp::ChainableMockMethod<void> mmvd0(MOCKPP_PCHAR("mm0"), 0); @@ -187,14 +185,15 @@ chain.stubs(mockpp::once()) .will(new IncCounter<unsigned>(counter)); -// @todo MOCKPP_ASSERT_EQUALS(1u, counter); chain.stubs(mockpp::once()) .will(new IncCounter<unsigned>(counter)); -// @todo MOCKPP_ASSERT_EQUALS(2u, counter); mcm.chainablev(); + MOCKPP_ASSERT_EQUALS(1u, counter); + mcm.chainablev(); + MOCKPP_ASSERT_EQUALS(2u, counter); try { @@ -214,3 +213,4 @@ #endif // HAVE_CPPUNIT + Index: ChainableMockMethod_1_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockMethod_1_test.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ChainableMockMethod_1_test.cpp 25 Oct 2005 20:20:18 -0000 1.8 +++ ChainableMockMethod_1_test.cpp 3 Nov 2005 20:44:06 -0000 1.9 @@ -145,15 +145,16 @@ chain.stubs(mockpp::once()) .with(mockpp::eq(12u)) .will(new IncCounter<unsigned>(counter)); -// @todo MOCKPP_ASSERT_EQUALS(1u, counter); chain.stubs(mockpp::once()) .with(mockpp::eq(34u)) .will(new IncCounter<unsigned>(counter)); -// @todo MOCKPP_ASSERT_EQUALS(2u, counter); mcm.chainablev(12); + MOCKPP_ASSERT_EQUALS(1u, counter); + mcm.chainablev(34); + MOCKPP_ASSERT_EQUALS(2u, counter); try { @@ -173,3 +174,4 @@ #endif // HAVE_CPPUNIT + Index: ChainableMockMethod_2_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockMethod_2_test.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ChainableMockMethod_2_test.cpp 25 Oct 2005 20:20:18 -0000 1.6 +++ ChainableMockMethod_2_test.cpp 3 Nov 2005 20:44:06 -0000 1.7 @@ -143,20 +143,24 @@ mockpp::ChainableMockMethod2<void, unsigned, long>::ChainerFor chain(mcm.chainablev_mocker); unsigned counter = 0; +// IncCounter<unsigned> ctr(counter); +// ctr.typelessInvoke(); + chain.stubs(mockpp::once()) .with(mockpp::eq<unsigned>(12u), mockpp::eq<long>(23)) .will(new IncCounter<unsigned>(counter)); -// @todo MOCKPP_ASSERT_EQUALS(1u, counter); chain.stubs(mockpp::once()) .with(mockpp::eq<unsigned>(34), mockpp::eq<long>(45)) .will(new IncCounter<unsigned>(counter)); -// @todo MOCKPP_ASSERT_EQUALS(2u, counter); mcm.chainablev(12, 23); + MOCKPP_ASSERT_EQUALS(1u, counter); + mcm.chainablev(34, 45); + MOCKPP_ASSERT_EQUALS(2u, counter); try { @@ -176,3 +180,4 @@ #endif // HAVE_CPPUNIT + |
From: Ewald A. <ewa...@us...> - 2005-11-02 20:57:38
|
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11364/mockpp/tests Modified Files: ResponseVector_test.cpp Log Message: more tests Index: ResponseVector_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ResponseVector_test.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ResponseVector_test.cpp 31 Oct 2005 19:08:10 -0000 1.3 +++ ResponseVector_test.cpp 2 Nov 2005 20:57:30 -0000 1.4 @@ -47,12 +47,14 @@ CPPUNIT_TEST_SUITE( ResponseVector_Test ); + CPPUNIT_TEST(test_value); CPPUNIT_TEST(test_thrower); CPPUNIT_TEST_SUITE_END(); public: + void test_value(); void test_thrower(); }; @@ -60,9 +62,85 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ResponseVector_Test); +void ResponseVector_Test::test_value() +{ + mockpp::ResponseVector3<long, int, int, int> rtv(MOCKPP_PCHAR("rtv3"), 0); + rtv.add(mockpp::make_throwable(int(123)), 10, 20, 30, 2); + rtv.add(mockpp::make_throwable(int(321)), 30, 20, 10, MOCKPP_UNLIMITED); + + rtv.add(long(456), 11, 21, 31, 2); + rtv.add(long(654), 31, 21, 11, MOCKPP_UNLIMITED); + + mockpp::Throwable *t; + + MOCKPP_ASSERT_TRUE(rtv.find(t, 30, 20, 10)); + MOCKPP_ASSERT_THROWING(t->throw_me(), + MOCKPP_PCHAR("321"), + int, + int(321)); + + long r; + MOCKPP_ASSERT_FALSE(rtv.find(r, 32, 22, 12)); + MOCKPP_ASSERT_TRUE(rtv.find(r, 31, 21, 11)); + MOCKPP_ASSERT_TRUE(r == 654); + + MOCKPP_ASSERT_TRUE(rtv.find(r, 11, 21, 31)); + MOCKPP_ASSERT_TRUE(r == 456); + + MOCKPP_ASSERT_TRUE(rtv.find(r, 31, 21, 11)); + MOCKPP_ASSERT_TRUE(r == 654); + + MOCKPP_ASSERT_TRUE(rtv.find(r, 11, 21, 31)); + MOCKPP_ASSERT_TRUE(r == 456); + + MOCKPP_ASSERT_TRUE(rtv.find(r, 31, 21, 11)); + MOCKPP_ASSERT_TRUE(r == 654); + + MOCKPP_ASSERT_FALSE(rtv.find(r, 11, 21, 31)); + + MOCKPP_ASSERT_FALSE(rtv.find(t, 10, 10, 10)); + + MOCKPP_ASSERT_TRUE(rtv.find(t, 10, 20, 30)); + MOCKPP_ASSERT_TRUE(rtv.find(t, 10, 20, 30)); + MOCKPP_ASSERT_FALSE(rtv.find(t, 10, 20, 30)); + + MOCKPP_ASSERT_TRUE(rtv.find(t, 30, 20, 10)); + MOCKPP_ASSERT_TRUE(rtv.find(t, 30, 20, 10)); + MOCKPP_ASSERT_TRUE(rtv.find(t, 30, 20, 10)); +} + + void ResponseVector_Test::test_thrower() { mockpp::ResponseThrowableVector3<int, int, int> rtv(MOCKPP_PCHAR("rtv3"), 0); + + rtv.add(mockpp::make_throwable(int(123)), 10, 20, 30, 1); + rtv.add(mockpp::make_throwable(int(321)), 30, 20, 10, MOCKPP_UNLIMITED); + rtv.add(0, 10, 10, 10, MOCKPP_UNLIMITED); + + mockpp::Throwable *t; + + MOCKPP_ASSERT_TRUE(rtv.find(t, 30, 20, 10)); + MOCKPP_ASSERT_THROWING(t->throw_me(), + MOCKPP_PCHAR("321"), + int, + int(321)); + + MOCKPP_ASSERT_TRUE(rtv.find(t, 10, 20, 30)); + MOCKPP_ASSERT_THROWING(t->throw_me(), + MOCKPP_PCHAR("123"), + int, + int(123)); + + MOCKPP_ASSERT_FALSE(rtv.find(t, 10, 10, 10)); + + MOCKPP_ASSERT_FALSE(rtv.find(t, 10, 20, 30)); + + MOCKPP_ASSERT_TRUE(rtv.find(t, 30, 20, 10)); + MOCKPP_ASSERT_THROWING(t->throw_me(), + MOCKPP_PCHAR("321"), + int, + int(321)); } |
From: Ewald A. <ewa...@us...> - 2005-11-02 19:36:29
|
Update of /cvsroot/mockpp/mockpp/mockpp/docs/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26700/mockpp/docs/api Modified Files: Makefile.am Log Message: fix for package creation Index: Makefile.am =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/docs/api/Makefile.am,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Makefile.am 28 Oct 2005 21:27:16 -0000 1.20 +++ Makefile.am 2 Nov 2005 19:36:18 -0000 1.21 @@ -50,13 +50,13 @@ htmldir = $(pkgdatadir)/html install-data-hook: doc - $(mkdir_p) $(htmldir)/api-doc - -find html | xargs -n 1 cp -v -t $(htmldir)/api-doc -# $(INSTALL) html/* $(htmldir)/api-doc + $(mkdir_p) $(DESTDIR)$(htmldir)/api-doc + -find html | xargs -n 1 cp -v -t $(DESTDIR)$(htmldir)/api-doc +# $(INSTALL) html/* $(DESTDIR)$(htmldir)/api-doc # Automake's "distcheck" is sensitive to having files left over # after "make uninstall", so we have to clean up the install hook. uninstall-local: - rm -rf $(htmldir)/api-doc + rm -rf $(DESTDIR)$(htmldir)/api-doc ################################################################# |
From: Ewald A. <ewa...@us...> - 2005-11-02 19:36:26
|
Update of /cvsroot/mockpp/mockpp/mockpp/docs/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26700/mockpp/docs/en Modified Files: Makefile.am Log Message: fix for package creation Index: Makefile.am =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/docs/en/Makefile.am,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- Makefile.am 29 Oct 2005 21:00:27 -0000 1.33 +++ Makefile.am 2 Nov 2005 19:36:18 -0000 1.34 @@ -78,17 +78,17 @@ htmldir = $(pkgdatadir)/html install-data-hook: doc - $(mkdir_p) $(htmldir)/handbook/common - $(mkdir_p) $(htmldir)/handbook/images/callouts - $(INSTALL) var/*.html $(htmldir)/handbook - $(INSTALL) $(srcdir)/common/*.css $(htmldir)/handbook/common - $(INSTALL) $(srcdir)/images/*.png $(htmldir)/handbook/images - $(INSTALL) $(srcdir)/images/callouts/*.png $(htmldir)/handbook/images/callouts + $(mkdir_p) $(DESTDIR)$(htmldir)/handbook/common + $(mkdir_p) $(DESTDIR)$(htmldir)/handbook/images/callouts + $(INSTALL) var/*.html $(DESTDIR)$(htmldir)/handbook + $(INSTALL) $(srcdir)/common/*.css $(DESTDIR)$(htmldir)/handbook/common + $(INSTALL) $(srcdir)/images/*.png $(DESTDIR)$(htmldir)/handbook/images + $(INSTALL) $(srcdir)/images/callouts/*.png $(DESTDIR)$(htmldir)/handbook/images/callouts # Automake's "distcheck" is sensitive to having files left over # after "make uninstall", so we have to clean up the install hook. uninstall-local: - rm -rf $(htmldir)/handbook + rm -rf $(DESTDIR)$(htmldir)/handbook ################################################################# |
From: Ewald A. <ewa...@us...> - 2005-11-01 09:42:28
|
Update of /cvsroot/mockpp/mockpp/msvc71/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12858/mockpp/tests Modified Files: mock_test.vcproj Log Message: update Index: mock_test.vcproj =================================================================== RCS file: /cvsroot/mockpp/mockpp/msvc71/mockpp/tests/mock_test.vcproj,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- mock_test.vcproj 31 Oct 2005 19:02:44 -0000 1.9 +++ mock_test.vcproj 1 Nov 2005 09:42:19 -0000 1.10 @@ -83,7 +83,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""G:\data\src\cppunit-1.10.2\include\cppunit";..\..\..;"$(CPPUNIT_ROOT)/include"" + AdditionalIncludeDirectories=""G:\data\src\cppunit-1.10.2\include";..\..\..;"$(CPPUNIT_ROOT)/include"" PreprocessorDefinitions="WIN32,_CONSOLE,CPPUNIT_DLL" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -166,6 +166,15 @@ RelativePath="..\..\..\mockpp\tests\AssertMo_test.cpp"> </File> <File + RelativePath="..\..\..\mockpp\tests\ChainableMockMethod_1_test.cpp"> + </File> + <File + RelativePath="..\..\..\mockpp\tests\ChainableMockMethod_2_test.cpp"> + </File> + <File + RelativePath="..\..\..\mockpp\tests\ChainableMockMethod_test.cpp"> + </File> + <File RelativePath="..\..\..\mockpp\tests\ChainableMockObject_1_test.cpp"> </File> <File @@ -424,6 +433,15 @@ RelativePath="..\..\..\mockpp\tests\VerifyingTestCase_test.cpp"> </File> <File + RelativePath="..\..\..\mockpp\tests\VisitableMockMethod_1_test.cpp"> + </File> + <File + RelativePath="..\..\..\mockpp\tests\VisitableMockMethod_2_test.cpp"> + </File> + <File + RelativePath="..\..\..\mockpp\tests\VisitableMockMethod_test.cpp"> + </File> + <File RelativePath="..\..\..\mockpp\tests\VisitableMockObject_1_test.cpp"> </File> <File |
From: Ewald A. <ewa...@us...> - 2005-11-01 09:42:28
|
Update of /cvsroot/mockpp/mockpp/msvc71/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12858/mockpp Modified Files: mockpp.vcproj Log Message: update Index: mockpp.vcproj =================================================================== RCS file: /cvsroot/mockpp/mockpp/msvc71/mockpp/mockpp.vcproj,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- mockpp.vcproj 31 Oct 2005 19:02:44 -0000 1.8 +++ mockpp.vcproj 1 Nov 2005 09:42:19 -0000 1.9 @@ -314,12 +314,21 @@ RelativePath="..\..\mockpp\AbstractExpectationCollection.h"> </File> <File + RelativePath="..\..\mockpp\builder\ArgumentsMatchBuilderN.h"> + </File> + <File RelativePath="..\..\mockpp\chainable-template.h"> </File> <File RelativePath="..\..\mockpp\ChainableMockObject.h"> </File> <File + RelativePath="..\..\mockpp\CountedVisitableMethod.h"> + </File> + <File + RelativePath="..\..\mockpp\CountParameters.h"> + </File> + <File RelativePath="..\..\mockpp\Expectation.h"> </File> <File @@ -374,6 +383,24 @@ RelativePath="..\..\mockpp\MockTimeServer.h"> </File> <File + RelativePath="..\..\mockpp\ResponseVector1.h"> + </File> + <File + RelativePath="..\..\mockpp\ResponseVector2.h"> + </File> + <File + RelativePath="..\..\mockpp\ResponseVector3.h"> + </File> + <File + RelativePath="..\..\mockpp\ResponseVector4.h"> + </File> + <File + RelativePath="..\..\mockpp\ResponseVector5.h"> + </File> + <File + RelativePath="..\..\mockpp\ResponseVector6.h"> + </File> + <File RelativePath="..\..\mockpp\ReturnObjectList.h"> </File> <File @@ -404,6 +431,30 @@ RelativePath="..\..\mockpp\visitable-template.h"> </File> <File + RelativePath="..\..\mockpp\VisitableMockMethod.h"> + </File> + <File + RelativePath="..\..\mockpp\VisitableMockMethod0.h"> + </File> + <File + RelativePath="..\..\mockpp\VisitableMockMethod1.h"> + </File> + <File + RelativePath="..\..\mockpp\VisitableMockMethod2.h"> + </File> + <File + RelativePath="..\..\mockpp\VisitableMockMethod3.h"> + </File> + <File + RelativePath="..\..\mockpp\VisitableMockMethod4.h"> + </File> + <File + RelativePath="..\..\mockpp\VisitableMockMethod5.h"> + </File> + <File + RelativePath="..\..\mockpp\VisitableMockMethod6.h"> + </File> + <File RelativePath="..\..\mockpp\VisitableMockObject.h"> </File> <File @@ -451,6 +502,30 @@ RelativePath="..\..\mockpp\chaining\AbstractInvocationDispatcher.h"> </File> <File + RelativePath="..\..\mockpp\chaining\ChainableMockMethod.h"> + </File> + <File + RelativePath="..\..\mockpp\chaining\ChainableMockMethod0.h"> + </File> + <File + RelativePath="..\..\mockpp\chaining\ChainableMockMethod1.h"> + </File> + <File + RelativePath="..\..\mockpp\chaining\ChainableMockMethod2.h"> + </File> + <File + RelativePath="..\..\mockpp\chaining\ChainableMockMethod3.h"> + </File> + <File + RelativePath="..\..\mockpp\chaining\ChainableMockMethod4.h"> + </File> + <File + RelativePath="..\..\mockpp\chaining\ChainableMockMethod5.h"> + </File> + <File + RelativePath="..\..\mockpp\chaining\ChainableMockMethod6.h"> + </File> + <File RelativePath="..\..\mockpp\chaining\ChainableMockObject_macro.h"> </File> <File @@ -463,6 +538,9 @@ RelativePath="..\..\mockpp\chaining\CoreMock.h"> </File> <File + RelativePath="..\..\mockpp\chaining\CountedChainableMethod.h"> + </File> + <File RelativePath="..\..\mockpp\chaining\DynamicChainingMock.h"> </File> <File @@ -481,6 +559,9 @@ RelativePath="..\..\mockpp\chaining\InvocationMocker.h"> </File> <File + RelativePath="..\..\mockpp\chaining\InvocationN.h"> + </File> + <File RelativePath="..\..\mockpp\chaining\Invokable.h"> </File> <File |
From: Ewald A. <ewa...@us...> - 2005-11-01 09:42:28
|
Update of /cvsroot/mockpp/mockpp/msvc71/mockpp/examples/tutorial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12858/mockpp/examples/tutorial Modified Files: cppunit.vcproj Log Message: update Index: cppunit.vcproj =================================================================== RCS file: /cvsroot/mockpp/mockpp/msvc71/mockpp/examples/tutorial/cppunit.vcproj,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- cppunit.vcproj 26 Sep 2005 19:12:39 -0000 1.5 +++ cppunit.vcproj 1 Nov 2005 09:42:19 -0000 1.6 @@ -21,7 +21,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories="../../../..,$(CPPUNIT_ROOT)/include" + AdditionalIncludeDirectories=""G:\data\src\cppunit-1.10.2\include";../../../..;"$(CPPUNIT_ROOT)/include"" PreprocessorDefinitions="WIN32,_CONSOLE,CPPUNIT_DLL" BasicRuntimeChecks="3" RuntimeLibrary="3" |
From: Ewald A. <ewa...@us...> - 2005-11-01 08:43:35
|
Update of /cvsroot/mockpp/mockpp/bcb5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2482 Modified Files: mock_test.bpf mock_test.bpr readability.bpr Log Message: update Index: mock_test.bpf =================================================================== RCS file: /cvsroot/mockpp/mockpp/bcb5/mock_test.bpf,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- mock_test.bpf 31 Oct 2005 19:19:52 -0000 1.38 +++ mock_test.bpf 1 Nov 2005 08:43:27 -0000 1.39 @@ -46,6 +46,6 @@ USEUNIT("..\mockpp\tests\VisitableMockMethod_test.cpp"); USEUNIT("..\mockpp\tests\VisitableMockMethod_1_test.cpp"); USEUNIT("..\mockpp\tests\VisitableMockMethod_2_test.cpp"); -USEUNIT("\\192.168.2.1\ewald\Documents\src\mockpp\mockpp\mockpp\tests\ResponseVector_test.cpp"); +USEUNIT("..\mockpp\tests\ResponseVector_test.cpp"); //--------------------------------------------------------------------------- Index: readability.bpr =================================================================== RCS file: /cvsroot/mockpp/mockpp/bcb5/readability.bpr,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- readability.bpr 31 Oct 2005 19:19:52 -0000 1.8 +++ readability.bpr 1 Nov 2005 08:43:27 -0000 1.9 @@ -73,36 +73,36 @@ [HistoryLists\hlIncludePath] Count=30 -Item0=..\mockpp\tests;..\..\mockpp;$(BCB)\include;..\..\..\cppunit-1.10.2\include -Item1=..\mockpp\tests;..;$(BCB)\include;X:\Documents\src\cppunit-1.10.2\include\ -Item2=..\.;$(BCB)\include;X:\Documents\src\cppunit-1.10.2\include -Item3=mockpp\tests;\\SONNE\HOMES\Documents\src\mockpp\mockpp\mockpp\tests;..\mockpp\tests;..\mockpp\examples\tutorial;..\mockpp_34\examples\tutorial;..\mockpp_34\examples;..\mockpp_34\tests;..\..\mockpp;$(BCB)\include;..\..\..\cppunit-1.10.2\include;..\..\cppunit-1.10\include -Item4=..\mockpp\examples\tutorial;..\mockpp_34\examples\tutorial;..\mockpp_34\examples;..\mockpp_34\tests;..\..\mockpp;$(BCB)\include;..\..\..\cppunit-1.10.2\include;..\..\cppunit-1.10\include -Item5=..\mockpp\examples\tutorial;..\mockpp_34\examples\tutorial;..\mockpp_34\examples;..\mockpp_34\tests;..\..\mockpp;$(BCB)\include;..\..\..\cppunit-1.10.2\include -Item6=..\mockpp_34\examples\tutorial;..\mockpp_34\examples;..\mockpp_34\tests;..;$(BCB)\include;..\..\..\cppunit.ups\include -Item7=..\mockpp_34\examples\tutorial;..\mockpp_34\examples;..\mockpp_34\tests;..;$(BCB)\include;..\..\cppunit\include;..\..\..\cppunit-1.8.0\include -Item8=..\mockpp_34\examples;..\mockpp_34\tests;..\..\mockpp;$(BCB)\include;..\..\cppunit\include;..\..\..\cppunit-1.8.0\include -Item9=..\mockpp_34\tests;..;$(BCB)\include;..\..\cppunit\include;X:\src\cppunit-1.8.0\include -Item10=..\mockpp_34\tests;..;$(BCB)\include;..\..\cppunit\include -Item11=..\mockpp_34\tests;..;$(BCB)\include;B:\cvs\ups\src\3party\cppunit\include -Item12=..\mockpp_34\tests;..;$(BCB)\include;..\..\..\cppunit-1.8.0\include -Item13=..;$(BCB)\include;..\..\..\cppunit-1.8.0\include -Item14=..\mockpp_34\tests;\\SONNE\HOMES\src\mockpp_34\mockpp\mockpp_34\tests;..\..\mockpp;$(BCB)\include;..\..\..\cppunit-1.8.0\include -Item15=..;$(BCB)\include;X:\src\cppunit-1.8.0\include -Item16=\\SONNE\HOMES\src\mockpp_34\mockpp\mockpp_34\tests;..\..\mockpp;..\mockpp_34\tests;..\mockpp;..\expat;$(BCB)\include -Item17=..;..\mockpp_34\tests;..\mockpp;..\expat;$(BCB)\include -Item18=..\..\mockpp;..\mockpp_34\tests;..\mockpp;..\expat;$(BCB)\include -Item19=..\..\mockpp;..\mockpp_34\tests;..\mockpp;..\expat;$(BCB)\include;$(BCB)\include\vcl;C:\wx2\include\ -Item20=.. ;..\mockpp_34\tests;..\mockpp;..\expat;$(BCB)\include;$(BCB)\include\vcl;C:\wx2\include\ -Item21=.. ;..\mockpp_34\tests;..\expat;..\mockpp;$(BCB)\include;$(BCB)\include\vcl;C:\wx2\include -Item22=..\mockpp_34\tests;..\expat;..\mockpp;$(BCB)\include;$(BCB)\include\vcl -Item23=..\mockpp_34\tests;..\mockpp;$(BCB)\include;$(BCB)\include\vcl;expat -Item24=..\mockpp;$(BCB)\include;$(BCB)\include\vcl;expat -Item25=..\mockpp_34\tests;..\mockpp;$(BCB)\include;$(BCB)\include\vcl -Item26=..\mockpp_34\tests;..\mockpp;$(BCB)\include -Item27=..\mockpp_34\tests;..\mockpp;$(BCB)/include -Item28=..\mockpp_34\tests;..\mockpp -Item29=..\mockpp +Item0=..\mockpp\tests;..;$(BCB)\include;..\..\..\cppunit-1.10.2\include +Item1=..\mockpp\tests;..\..\mockpp;$(BCB)\include;..\..\..\cppunit-1.10.2\include +Item2=..\mockpp\tests;..;$(BCB)\include;X:\Documents\src\cppunit-1.10.2\include\ +Item3=..\.;$(BCB)\include;X:\Documents\src\cppunit-1.10.2\include +Item4=mockpp\tests;\\SONNE\HOMES\Documents\src\mockpp\mockpp\mockpp\tests;..\mockpp\tests;..\mockpp\examples\tutorial;..\mockpp_34\examples\tutorial;..\mockpp_34\examples;..\mockpp_34\tests;..\..\mockpp;$(BCB)\include;..\..\..\cppunit-1.10.2\include;..\..\cppunit-1.10\include +Item5=..\mockpp\examples\tutorial;..\mockpp_34\examples\tutorial;..\mockpp_34\examples;..\mockpp_34\tests;..\..\mockpp;$(BCB)\include;..\..\..\cppunit-1.10.2\include;..\..\cppunit-1.10\include +Item6=..\mockpp\examples\tutorial;..\mockpp_34\examples\tutorial;..\mockpp_34\examples;..\mockpp_34\tests;..\..\mockpp;$(BCB)\include;..\..\..\cppunit-1.10.2\include +Item7=..\mockpp_34\examples\tutorial;..\mockpp_34\examples;..\mockpp_34\tests;..;$(BCB)\include;..\..\..\cppunit.ups\include +Item8=..\mockpp_34\examples\tutorial;..\mockpp_34\examples;..\mockpp_34\tests;..;$(BCB)\include;..\..\cppunit\include;..\..\..\cppunit-1.8.0\include +Item9=..\mockpp_34\examples;..\mockpp_34\tests;..\..\mockpp;$(BCB)\include;..\..\cppunit\include;..\..\..\cppunit-1.8.0\include +Item10=..\mockpp_34\tests;..;$(BCB)\include;..\..\cppunit\include;X:\src\cppunit-1.8.0\include +Item11=..\mockpp_34\tests;..;$(BCB)\include;..\..\cppunit\include +Item12=..\mockpp_34\tests;..;$(BCB)\include;B:\cvs\ups\src\3party\cppunit\include +Item13=..\mockpp_34\tests;..;$(BCB)\include;..\..\..\cppunit-1.8.0\include +Item14=..;$(BCB)\include;..\..\..\cppunit-1.8.0\include +Item15=..\mockpp_34\tests;\\SONNE\HOMES\src\mockpp_34\mockpp\mockpp_34\tests;..\..\mockpp;$(BCB)\include;..\..\..\cppunit-1.8.0\include +Item16=..;$(BCB)\include;X:\src\cppunit-1.8.0\include +Item17=\\SONNE\HOMES\src\mockpp_34\mockpp\mockpp_34\tests;..\..\mockpp;..\mockpp_34\tests;..\mockpp;..\expat;$(BCB)\include +Item18=..;..\mockpp_34\tests;..\mockpp;..\expat;$(BCB)\include +Item19=..\..\mockpp;..\mockpp_34\tests;..\mockpp;..\expat;$(BCB)\include +Item20=..\..\mockpp;..\mockpp_34\tests;..\mockpp;..\expat;$(BCB)\include;$(BCB)\include\vcl;C:\wx2\include\ +Item21=.. ;..\mockpp_34\tests;..\mockpp;..\expat;$(BCB)\include;$(BCB)\include\vcl;C:\wx2\include\ +Item22=.. ;..\mockpp_34\tests;..\expat;..\mockpp;$(BCB)\include;$(BCB)\include\vcl;C:\wx2\include +Item23=..\mockpp_34\tests;..\expat;..\mockpp;$(BCB)\include;$(BCB)\include\vcl +Item24=..\mockpp_34\tests;..\mockpp;$(BCB)\include;$(BCB)\include\vcl;expat +Item25=..\mockpp;$(BCB)\include;$(BCB)\include\vcl;expat +Item26=..\mockpp_34\tests;..\mockpp;$(BCB)\include;$(BCB)\include\vcl +Item27=..\mockpp_34\tests;..\mockpp;$(BCB)\include +Item28=..\mockpp_34\tests;..\mockpp;$(BCB)/include +Item29=..\mockpp_34\tests;..\mockpp [HistoryLists\hlLibraryPath] Count=20 Index: mock_test.bpr =================================================================== RCS file: /cvsroot/mockpp/mockpp/bcb5/mock_test.bpr,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- mock_test.bpr 31 Oct 2005 19:19:52 -0000 1.43 +++ mock_test.bpr 1 Nov 2005 08:43:27 -0000 1.44 @@ -57,7 +57,7 @@ ibsmp50.bpi VCLDBX50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi TEEQR50.bpi VCLIB50.bpi bcbie50.bpi VCLIE50.bpi INETDB50.bpi INET50.bpi NMFAST50.bpi dclocx50.bpi bcb2kaxserver50.bpi"/> - <PATHCPP value=".;..\mockpp\tests;\\192.168.2.1\ewald\Documents\src\mockpp\mockpp\mockpp\tests"/> + <PATHCPP value=".;..\mockpp\tests"/> <PATHPAS value=".;"/> <PATHRC value=".;"/> <PATHASM value=".;"/> |
From: Ewald A. <ewa...@us...> - 2005-10-31 20:50:45
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24325/mockpp Modified Files: CountedVisitableMethod.h CountParameters.h gen_countparams_N.pl gen_countvisitable_N.pl Log Message: added docs Index: CountedVisitableMethod.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/CountedVisitableMethod.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CountedVisitableMethod.h 31 Oct 2005 19:01:00 -0000 1.2 +++ CountedVisitableMethod.h 31 Oct 2005 20:50:37 -0000 1.3 @@ -44,19 +44,31 @@ namespace mockpp { + #ifndef MOCKPP_COUNTED_WEAKNESS + +/** Helper class to select the method mock with the correct number of parameters. + * Works with meta programming. + * @internal + */ template<unsigned params> class SwitchVisitable { }; +/** Helper class to select the method mock with 0 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchVisitable<0> { public: + /** Helper class with an embeded type to the the method mock with 0 parameters. + */ template< typename R , typename P1 , typename P2 @@ -73,11 +85,17 @@ }; +/** Helper class to select the method mock with 1 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchVisitable<1> { public: + /** Helper class with an embeded type to the the method mock with 1 parameters. + */ template< typename R , typename P1 , typename P2 @@ -94,11 +112,17 @@ }; +/** Helper class to select the method mock with 2 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchVisitable<2> { public: + /** Helper class with an embeded type to the the method mock with 2 parameters. + */ template< typename R , typename P1 , typename P2 @@ -115,11 +139,17 @@ }; +/** Helper class to select the method mock with 3 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchVisitable<3> { public: + /** Helper class with an embeded type to the the method mock with 3 parameters. + */ template< typename R , typename P1 , typename P2 @@ -136,11 +166,17 @@ }; +/** Helper class to select the method mock with 4 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchVisitable<4> { public: + /** Helper class with an embeded type to the the method mock with 4 parameters. + */ template< typename R , typename P1 , typename P2 @@ -157,11 +193,17 @@ }; +/** Helper class to select the method mock with 5 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchVisitable<5> { public: + /** Helper class with an embeded type to the the method mock with 5 parameters. + */ template< typename R , typename P1 , typename P2 @@ -178,11 +220,17 @@ }; +/** Helper class to select the method mock with 6 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchVisitable<6> { public: + /** Helper class with an embeded type to the the method mock with 6 parameters. + */ template< typename R , typename P1 , typename P2 @@ -199,6 +247,9 @@ }; +/** Method mock class to select the actual class with the desired number of parameters. + * Works with meta programming. + */ template< typename R , typename P1 = NoParameter , typename P2 = NoParameter @@ -213,6 +264,10 @@ { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ VisitableMockMethod(const String &name, VisitableMockObject *parent ) : SwitchVisitable<CountParameters<R, P1, P2, P3, P4, P5, P6>::value > ::template Method<R, P1, P2, P3, P4, P5, P6> @@ -225,6 +280,10 @@ #else // MOCKPP_COUNTED_WEAKNESS +/** Helper class to select the method mock with the correct number of parameters. + * Works with partial specialisation. + * @internal + */ template< typename R , typename P1 = NoParameter , typename P2 = NoParameter @@ -238,12 +297,19 @@ }; +/** Method mock class to select the actual class with 0 parameters. + * Works with partial specialisation. + */ template<typename R> class VisitableMockMethod<R, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> : public VisitableMockMethod0<R> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ VisitableMockMethod<R, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> (const String &name, VisitableMockObject *parent ) : VisitableMockMethod0<R>(name, parent) @@ -252,12 +318,19 @@ }; +/** Method mock class to select the actual class with 1 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1> class VisitableMockMethod<R, P1, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> : public VisitableMockMethod1<R, P1> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ VisitableMockMethod<R, P1, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> (const String &name, VisitableMockObject *parent ) : VisitableMockMethod1<R, P1>(name, parent) @@ -266,12 +339,19 @@ }; +/** Method mock class to select the actual class with 2 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1, typename P2> class VisitableMockMethod<R, P1, P2, NoParameter, NoParameter, NoParameter, NoParameter> : public VisitableMockMethod2<R, P1, P2> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ VisitableMockMethod<R, P1, P2, NoParameter, NoParameter, NoParameter, NoParameter> (const String &name, VisitableMockObject *parent ) : VisitableMockMethod2<R, P1, P2>(name, parent) @@ -280,12 +360,19 @@ }; +/** Method mock class to select the actual class with 3 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1, typename P2, typename P3> class VisitableMockMethod<R, P1, P2, P3, NoParameter, NoParameter, NoParameter> : public VisitableMockMethod3<R, P1, P2, P3> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ VisitableMockMethod<R, P1, P2, P3, NoParameter, NoParameter, NoParameter> (const String &name, VisitableMockObject *parent ) : VisitableMockMethod3<R, P1, P2, P3>(name, parent) @@ -294,12 +381,19 @@ }; +/** Method mock class to select the actual class with 4 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1, typename P2, typename P3, typename P4> class VisitableMockMethod<R, P1, P2, P3, P4, NoParameter, NoParameter> : public VisitableMockMethod4<R, P1, P2, P3, P4> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ VisitableMockMethod<R, P1, P2, P3, P4, NoParameter, NoParameter> (const String &name, VisitableMockObject *parent ) : VisitableMockMethod4<R, P1, P2, P3, P4>(name, parent) @@ -308,12 +402,19 @@ }; +/** Method mock class to select the actual class with 5 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1, typename P2, typename P3, typename P4, typename P5> class VisitableMockMethod<R, P1, P2, P3, P4, P5, NoParameter> : public VisitableMockMethod5<R, P1, P2, P3, P4, P5> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ VisitableMockMethod<R, P1, P2, P3, P4, P5, NoParameter> (const String &name, VisitableMockObject *parent ) : VisitableMockMethod5<R, P1, P2, P3, P4, P5>(name, parent) @@ -322,12 +423,19 @@ }; +/** Method mock class to select the actual class with 6 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6> class VisitableMockMethod<R, P1, P2, P3, P4, P5, P6> : public VisitableMockMethod6<R, P1, P2, P3, P4, P5, P6> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ VisitableMockMethod<R, P1, P2, P3, P4, P5, P6> (const String &name, VisitableMockObject *parent ) : VisitableMockMethod6<R, P1, P2, P3, P4, P5, P6>(name, parent) Index: CountParameters.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/CountParameters.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CountParameters.h 31 Oct 2005 19:01:00 -0000 1.2 +++ CountParameters.h 31 Oct 2005 20:50:37 -0000 1.3 @@ -35,12 +35,18 @@ namespace mockpp { +/** Helper class to distinguish present from missing parameters. + * @internal + */ class NoParameter { NoParameter() {} }; +/** Helper class to count actual parameters. + * @internal + */ template<typename T> class CountIfUsed { @@ -50,6 +56,9 @@ }; +/** Helper class to disable counting of non-parameters. + * @internal + */ template<> class CountIfUsed<NoParameter> { @@ -59,6 +68,9 @@ }; +/** Helper class to sum actual parameters. + * @internal + */ template< typename T , typename P1 = NoParameter , typename P2 = NoParameter Index: gen_countparams_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/gen_countparams_N.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gen_countparams_N.pl 30 Oct 2005 13:53:00 -0000 1.1 +++ gen_countparams_N.pl 31 Oct 2005 20:50:37 -0000 1.2 @@ -54,12 +54,18 @@ namespace mockpp { +/** Helper class to distinguish present from missing parameters. + * \@internal + */ class NoParameter { NoParameter() {} }; +/** Helper class to count actual parameters. + * \@internal + */ template<typename T> class CountIfUsed { @@ -69,6 +75,9 @@ }; +/** Helper class to disable counting of non-parameters. + * \@internal + */ template<> class CountIfUsed<NoParameter> { @@ -80,6 +89,9 @@ "; print OUT " +/** Helper class to sum actual parameters. + * \@internal + */ template< typename T , typename P1 = NoParameter"; Index: gen_countvisitable_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/gen_countvisitable_N.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gen_countvisitable_N.pl 31 Oct 2005 19:01:00 -0000 1.2 +++ gen_countvisitable_N.pl 31 Oct 2005 20:50:37 -0000 1.3 @@ -67,8 +67,14 @@ namespace mockpp { + #ifndef MOCKPP_COUNTED_WEAKNESS + +/** Helper class to select the method mock with the correct number of parameters. + * Works with meta programming. + * \@internal + */ template<unsigned params> class SwitchVisitable { @@ -103,6 +109,10 @@ print OUT " +/** Helper class to select the method mock with " . $numArgs ." parameters. + * Works with meta programming. + * \@internal + */ template<> class SwitchVisitable<" . $numArgs ."> { @@ -110,6 +120,8 @@ "; print OUT " + /** Helper class with an embeded type to the the method mock with " . $numArgs ." parameters. + */ template< typename R"; for($p = 1; $p <= $totalNumArgs; ++$p) { print OUT " @@ -130,6 +142,9 @@ print OUT " +/** Method mock class to select the actual class with the desired number of parameters. + * Works with meta programming. + */ template< typename R , typename P1 = NoParameter"; @@ -144,6 +159,10 @@ { public: + /** Constructs the mock object. + * \@param name human readable description about the expectation + * \@param parent parent chainable mock object + */ VisitableMockMethod(const String &name, VisitableMockObject *parent ) : SwitchVisitable<CountParameters<R, " . $templateArgs . ">::value > ::template Method<R, " . $templateArgs . "> @@ -156,6 +175,10 @@ #else // MOCKPP_COUNTED_WEAKNESS +/** Helper class to select the method mock with the correct number of parameters. + * Works with partial specialisation. + * \@internal + */ template< typename R , typename P1 = NoParameter"; @@ -200,12 +223,19 @@ print OUT " +/** Method mock class to select the actual class with " . $numArgs . " parameters. + * Works with partial specialisation. + */ template<typename R" . $templateParms_colon . "> class VisitableMockMethod<R, " . $noParamArgs . "> : public VisitableMockMethod" . $numArgs . "<R" . $templateArgs_colon . "> { public: + /** Constructs the mock object. + * \@param name human readable description about the expectation + * \@param parent parent chainable mock object + */ VisitableMockMethod<R, " . $noParamArgs . "> (const String &name, VisitableMockObject *parent ) : VisitableMockMethod" . $numArgs . "<R" . $templateArgs_colon . ">(name, parent) |
From: Ewald A. <ewa...@us...> - 2005-10-31 20:50:45
|
Update of /cvsroot/mockpp/mockpp/mockpp/chaining In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24325/mockpp/chaining Modified Files: CountedChainableMethod.h gen_countchainable_N.pl Log Message: added docs Index: CountedChainableMethod.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/CountedChainableMethod.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CountedChainableMethod.h 31 Oct 2005 19:01:00 -0000 1.2 +++ CountedChainableMethod.h 31 Oct 2005 20:50:37 -0000 1.3 @@ -47,17 +47,27 @@ #ifndef MOCKPP_COUNTED_WEAKNESS +/** Helper class to select the method mock with the correct number of parameters. + * Works with meta programming. + * @internal + */ template<unsigned params> class SwitchChainable { }; +/** Helper class to select the method mock with 0 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchChainable<0> { public: + /** Helper class with an embeded type to the the method mock with 0 parameters. + */ template< typename R , typename P1 , typename P2 @@ -74,11 +84,17 @@ }; +/** Helper class to select the method mock with 1 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchChainable<1> { public: + /** Helper class with an embeded type to the the method mock with 1 parameters. + */ template< typename R , typename P1 , typename P2 @@ -95,11 +111,17 @@ }; +/** Helper class to select the method mock with 2 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchChainable<2> { public: + /** Helper class with an embeded type to the the method mock with 2 parameters. + */ template< typename R , typename P1 , typename P2 @@ -116,11 +138,17 @@ }; +/** Helper class to select the method mock with 3 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchChainable<3> { public: + /** Helper class with an embeded type to the the method mock with 3 parameters. + */ template< typename R , typename P1 , typename P2 @@ -137,11 +165,17 @@ }; +/** Helper class to select the method mock with 4 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchChainable<4> { public: + /** Helper class with an embeded type to the the method mock with 4 parameters. + */ template< typename R , typename P1 , typename P2 @@ -158,11 +192,17 @@ }; +/** Helper class to select the method mock with 5 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchChainable<5> { public: + /** Helper class with an embeded type to the the method mock with 5 parameters. + */ template< typename R , typename P1 , typename P2 @@ -179,11 +219,17 @@ }; +/** Helper class to select the method mock with 6 parameters. + * Works with meta programming. + * @internal + */ template<> class SwitchChainable<6> { public: + /** Helper class with an embeded type to the the method mock with 6 parameters. + */ template< typename R , typename P1 , typename P2 @@ -200,6 +246,9 @@ }; +/** Method mock class to select the actual class with the desired number of parameters. + * Works with meta programming. + */ template< typename R , typename P1 = NoParameter , typename P2 = NoParameter @@ -214,6 +263,10 @@ { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ ChainableMockMethod(const String &name, ChainableMockObject *parent ) : SwitchChainable<CountParameters<R, P1, P2, P3, P4, P5, P6>::value > ::template Method<R, P1, P2, P3, P4, P5, P6> @@ -226,6 +279,10 @@ #else // MOCKPP_COUNTED_WEAKNESS +/** Helper class to select the method mock with the correct number of parameters. + * Works with partial specialisation. + * @internal + */ template< typename R , typename P1 = NoParameter , typename P2 = NoParameter @@ -233,18 +290,25 @@ , typename P4 = NoParameter , typename P5 = NoParameter , typename P6 = NoParameter - , typename P7 = NoParameter> + , typename P7 = NoParameter> // one more parameter to enabled full specialisation class ChainableMockMethod { }; +/** Method mock class to select the actual class with 0 parameters. + * Works with partial specialisation. + */ template<typename R> class ChainableMockMethod<R, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> : public ChainableMockMethod0<R> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ ChainableMockMethod<R, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> (const String &name, ChainableMockObject *parent ) : ChainableMockMethod0<R>(name, parent) @@ -253,12 +317,19 @@ }; +/** Method mock class to select the actual class with 1 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1> class ChainableMockMethod<R, P1, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> : public ChainableMockMethod1<R, P1> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ ChainableMockMethod<R, P1, NoParameter, NoParameter, NoParameter, NoParameter, NoParameter> (const String &name, ChainableMockObject *parent ) : ChainableMockMethod1<R, P1>(name, parent) @@ -267,12 +338,19 @@ }; +/** Method mock class to select the actual class with 2 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1, typename P2> class ChainableMockMethod<R, P1, P2, NoParameter, NoParameter, NoParameter, NoParameter> : public ChainableMockMethod2<R, P1, P2> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ ChainableMockMethod<R, P1, P2, NoParameter, NoParameter, NoParameter, NoParameter> (const String &name, ChainableMockObject *parent ) : ChainableMockMethod2<R, P1, P2>(name, parent) @@ -281,12 +359,19 @@ }; +/** Method mock class to select the actual class with 3 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1, typename P2, typename P3> class ChainableMockMethod<R, P1, P2, P3, NoParameter, NoParameter, NoParameter> : public ChainableMockMethod3<R, P1, P2, P3> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ ChainableMockMethod<R, P1, P2, P3, NoParameter, NoParameter, NoParameter> (const String &name, ChainableMockObject *parent ) : ChainableMockMethod3<R, P1, P2, P3>(name, parent) @@ -295,12 +380,19 @@ }; +/** Method mock class to select the actual class with 4 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1, typename P2, typename P3, typename P4> class ChainableMockMethod<R, P1, P2, P3, P4, NoParameter, NoParameter> : public ChainableMockMethod4<R, P1, P2, P3, P4> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ ChainableMockMethod<R, P1, P2, P3, P4, NoParameter, NoParameter> (const String &name, ChainableMockObject *parent ) : ChainableMockMethod4<R, P1, P2, P3, P4>(name, parent) @@ -309,12 +401,19 @@ }; +/** Method mock class to select the actual class with 5 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1, typename P2, typename P3, typename P4, typename P5> class ChainableMockMethod<R, P1, P2, P3, P4, P5, NoParameter> : public ChainableMockMethod5<R, P1, P2, P3, P4, P5> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ ChainableMockMethod<R, P1, P2, P3, P4, P5, NoParameter> (const String &name, ChainableMockObject *parent ) : ChainableMockMethod5<R, P1, P2, P3, P4, P5>(name, parent) @@ -323,12 +422,19 @@ }; +/** Method mock class to select the actual class with 6 parameters. + * Works with partial specialisation. + */ template<typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6> class ChainableMockMethod<R, P1, P2, P3, P4, P5, P6> : public ChainableMockMethod6<R, P1, P2, P3, P4, P5, P6> { public: + /** Constructs the mock object. + * @param name human readable description about the expectation + * @param parent parent chainable mock object + */ ChainableMockMethod<R, P1, P2, P3, P4, P5, P6> (const String &name, ChainableMockObject *parent ) : ChainableMockMethod6<R, P1, P2, P3, P4, P5, P6>(name, parent) Index: gen_countchainable_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/gen_countchainable_N.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- gen_countchainable_N.pl 31 Oct 2005 19:01:00 -0000 1.2 +++ gen_countchainable_N.pl 31 Oct 2005 20:50:37 -0000 1.3 @@ -65,6 +65,11 @@ #ifndef MOCKPP_COUNTED_WEAKNESS + +/** Helper class to select the method mock with the correct number of parameters. + * Works with meta programming. + * \@internal + */ template<unsigned params> class SwitchChainable { @@ -98,6 +103,10 @@ print "Creating CountedChainableMethod" . $numArgs ."\n"; print OUT " +/** Helper class to select the method mock with " . $numArgs ." parameters. + * Works with meta programming. + * \@internal + */ template<> class SwitchChainable<" . $numArgs ."> { @@ -105,6 +114,8 @@ "; print OUT " + /** Helper class with an embeded type to the the method mock with " . $numArgs ." parameters. + */ template< typename R"; for($p = 1; $p <= $totalNumArgs; ++$p) { print OUT " @@ -125,6 +136,9 @@ print OUT " +/** Method mock class to select the actual class with the desired number of parameters. + * Works with meta programming. + */ template< typename R , typename P1 = NoParameter"; @@ -139,6 +153,10 @@ { public: + /** Constructs the mock object. + * \@param name human readable description about the expectation + * \@param parent parent chainable mock object + */ ChainableMockMethod(const String &name, ChainableMockObject *parent ) : SwitchChainable<CountParameters<R, " . $templateArgs . ">::value > ::template Method<R, " . $templateArgs . "> @@ -151,13 +169,17 @@ #else // MOCKPP_COUNTED_WEAKNESS +/** Helper class to select the method mock with the correct number of parameters. + * Works with partial specialisation. + * \@internal + */ template< typename R , typename P1 = NoParameter"; for($p = 2; $p <= $totalNumArgs+1; ++$p) { print OUT " , typename P" . $p . " = NoParameter"; }; -print OUT "> +print OUT "> // one more parameter to enabled full specialisation class ChainableMockMethod { }; @@ -195,12 +217,19 @@ print OUT " +/** Method mock class to select the actual class with " . $numArgs . " parameters. + * Works with partial specialisation. + */ template<typename R" . $templateParms_colon . "> class ChainableMockMethod<R, " . $noParamArgs . "> : public ChainableMockMethod" . $numArgs . "<R" . $templateArgs_colon . "> { public: + /** Constructs the mock object. + * \@param name human readable description about the expectation + * \@param parent parent chainable mock object + */ ChainableMockMethod<R, " . $noParamArgs . "> (const String &name, ChainableMockObject *parent ) : ChainableMockMethod" . $numArgs . "<R" . $templateArgs_colon . ">(name, parent) |
From: Ewald A. <ewa...@us...> - 2005-10-31 19:24:18
|
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4349/mockpp/tests Modified Files: ChainableMockMethod_test.cpp Log Message: typo Index: ChainableMockMethod_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockMethod_test.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ChainableMockMethod_test.cpp 31 Oct 2005 19:01:00 -0000 1.9 +++ ChainableMockMethod_test.cpp 31 Oct 2005 19:24:10 -0000 1.10 @@ -37,8 +37,7 @@ #else -//#define MOCKPP_COUNTED_WEAKNESS // -only BCB5 +//#define MOCKPP_COUNTED_WEAKNESS // only BCB5 #include <mockpp/chaining/ChainableMockMethod.h> #include <mockpp/chaining/ChainableMockMethod0.h> |