Thread: [Mockpp-commits] mockpp/mockpp VisitableMockMethod.h,1.18,1.19 VisitableMockMethod0.h,1.8,1.9 Visita
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2005-11-13 14:07:20
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22022/mockpp Modified Files: VisitableMockMethod.h VisitableMockMethod0.h VisitableMockMethod1.h VisitableMockMethod2.h VisitableMockMethod3.h VisitableMockMethod4.h VisitableMockMethod5.h VisitableMockMethod6.h gen_visitablemethod_N.pl Log Message: fix evaluation order Index: VisitableMockMethod6.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod6.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- VisitableMockMethod6.h 13 Nov 2005 11:52:26 -0000 1.6 +++ VisitableMockMethod6.h 13 Nov 2005 14:07:12 -0000 1.7 @@ -141,10 +141,8 @@ } } - public: - /** 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. @@ -224,12 +222,16 @@ R forward(const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5, const P6 &p6) const { this->forward_param(p1, p2, p3, p4, p5, p6); + if (this->getVisitableMockObject()->isActivated() ) + { + R ret_val; + if (this->responseValues.find(ret_val, p1, p2, p3, p4, p5, p6)) + return ret_val; - R ret_val; - if (this->responseValues.find(ret_val, p1, p2, p3, p4, p5, p6)) - return ret_val; - - return this->determineReturnValue(); + return this->determineReturnValue(); + } + else + return R(); } /** Adds another response value. Index: VisitableMockMethod2.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod2.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- VisitableMockMethod2.h 13 Nov 2005 11:52:26 -0000 1.8 +++ VisitableMockMethod2.h 13 Nov 2005 14:07:12 -0000 1.9 @@ -113,10 +113,8 @@ } } - public: - /** 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. @@ -180,12 +178,16 @@ R forward(const P1 &p1, const P2 &p2) const { this->forward_param(p1, p2); + if (this->getVisitableMockObject()->isActivated() ) + { + R ret_val; + if (this->responseValues.find(ret_val, p1, p2)) + return ret_val; - R ret_val; - if (this->responseValues.find(ret_val, p1, p2)) - return ret_val; - - return this->determineReturnValue(); + return this->determineReturnValue(); + } + else + return R(); } /** Adds another response value. Index: gen_visitablemethod_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/gen_visitablemethod_N.pl,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- gen_visitablemethod_N.pl 13 Nov 2005 11:52:26 -0000 1.10 +++ gen_visitablemethod_N.pl 13 Nov 2005 14:07:12 -0000 1.11 @@ -296,14 +296,12 @@ } print OUT " - public: "; 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. @@ -392,20 +390,25 @@ */ R forward(" . $parms . ") const { - this->forward_param(" . $args . ");"; + this->forward_param(" . $args . "); + + if (this->getVisitableMockObject()->isActivated() ) + {"; if ($numArgs > 0) { print OUT " - - R ret_val; - if (this->responseValues.find(ret_val, " . $args . ")) - return ret_val; + R ret_val; + if (this->responseValues.find(ret_val, " . $args . ")) + return ret_val; "; } print OUT " - return this->determineReturnValue(); + return this->determineReturnValue(); + } + else + return R(); // only dummy value } "; Index: VisitableMockMethod3.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod3.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- VisitableMockMethod3.h 13 Nov 2005 11:52:26 -0000 1.8 +++ VisitableMockMethod3.h 13 Nov 2005 14:07:12 -0000 1.9 @@ -120,10 +120,8 @@ } } - public: - /** 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. @@ -191,12 +189,16 @@ R forward(const P1 &p1, const P2 &p2, const P3 &p3) const { this->forward_param(p1, p2, p3); + if (this->getVisitableMockObject()->isActivated() ) + { + R ret_val; + if (this->responseValues.find(ret_val, p1, p2, p3)) + return ret_val; - R ret_val; - if (this->responseValues.find(ret_val, p1, p2, p3)) - return ret_val; - - return this->determineReturnValue(); + return this->determineReturnValue(); + } + else + return R(); } /** Adds another response value. Index: VisitableMockMethod.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- VisitableMockMethod.h 13 Nov 2005 12:25:41 -0000 1.18 +++ VisitableMockMethod.h 13 Nov 2005 14:07:12 -0000 1.19 @@ -76,7 +76,8 @@ bool do_throw = true; if (throwablesInline) { - if (throwableInsteadReturn.size() != 0) + unsigned num = throwableInsteadReturn.size(); + if (num != 0) { do_throw = throwableInsteadReturn[0]; throwableInsteadReturn.erase(throwableInsteadReturn.begin()); @@ -261,7 +262,7 @@ */ R determineReturnValue() const { - throwableInsteadReturn.erase(throwableInsteadReturn.begin()); +// throwableInsteadReturn.erase(throwableInsteadReturn.begin()); if (returnValues.hasMoreObjects()) return returnValues.nextReturnObject(); Index: VisitableMockMethod4.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod4.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- VisitableMockMethod4.h 13 Nov 2005 11:52:26 -0000 1.8 +++ VisitableMockMethod4.h 13 Nov 2005 14:07:12 -0000 1.9 @@ -127,10 +127,8 @@ } } - public: - /** 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. @@ -202,12 +200,16 @@ R forward(const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4) const { this->forward_param(p1, p2, p3, p4); + if (this->getVisitableMockObject()->isActivated() ) + { + R ret_val; + if (this->responseValues.find(ret_val, p1, p2, p3, p4)) + return ret_val; - R ret_val; - if (this->responseValues.find(ret_val, p1, p2, p3, p4)) - return ret_val; - - return this->determineReturnValue(); + return this->determineReturnValue(); + } + else + return R(); } /** Adds another response value. Index: VisitableMockMethod0.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod0.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- VisitableMockMethod0.h 13 Nov 2005 11:52:26 -0000 1.8 +++ VisitableMockMethod0.h 13 Nov 2005 14:07:12 -0000 1.9 @@ -81,7 +81,6 @@ this->throwAvailableException(); } } - public: }; @@ -110,7 +109,12 @@ R forward() const { this->forward_param(); - return this->determineReturnValue(); + if (this->getVisitableMockObject()->isActivated() ) + { + return this->determineReturnValue(); + } + else + return R(); } }; Index: VisitableMockMethod5.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod5.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- VisitableMockMethod5.h 13 Nov 2005 11:52:26 -0000 1.8 +++ VisitableMockMethod5.h 13 Nov 2005 14:07:12 -0000 1.9 @@ -134,10 +134,8 @@ } } - public: - /** 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. @@ -213,12 +211,16 @@ R forward(const P1 &p1, const P2 &p2, const P3 &p3, const P4 &p4, const P5 &p5) const { this->forward_param(p1, p2, p3, p4, p5); + if (this->getVisitableMockObject()->isActivated() ) + { + R ret_val; + if (this->responseValues.find(ret_val, p1, p2, p3, p4, p5)) + return ret_val; - R ret_val; - if (this->responseValues.find(ret_val, p1, p2, p3, p4, p5)) - return ret_val; - - return this->determineReturnValue(); + return this->determineReturnValue(); + } + else + return R(); } /** Adds another response value. Index: VisitableMockMethod1.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod1.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- VisitableMockMethod1.h 13 Nov 2005 11:52:26 -0000 1.8 +++ VisitableMockMethod1.h 13 Nov 2005 14:07:12 -0000 1.9 @@ -106,10 +106,8 @@ } } - public: - /** 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. @@ -169,12 +167,16 @@ R forward(const P1 &p1) const { this->forward_param(p1); + if (this->getVisitableMockObject()->isActivated() ) + { + R ret_val; + if (this->responseValues.find(ret_val, p1)) + return ret_val; - R ret_val; - if (this->responseValues.find(ret_val, p1)) - return ret_val; - - return this->determineReturnValue(); + return this->determineReturnValue(); + } + else + return R(); } /** Adds another response value. |