[Mockpp-commits] mockpp/mockpp/chaining AbstractDynamicChainingMock.h,1.33,1.34 ChainingMockBuilder.
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2005-08-28 20:40:37
|
Update of /cvsroot/mockpp/mockpp/mockpp/chaining In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6376/mockpp/chaining Modified Files: AbstractDynamicChainingMock.h ChainingMockBuilder.h InvocationMocker.h Log Message: only assertionFailed() will throw exceptions Index: InvocationMocker.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/InvocationMocker.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- InvocationMocker.h 7 Apr 2005 20:31:10 -0000 1.33 +++ InvocationMocker.h 28 Aug 2005 20:40:23 -0000 1.34 @@ -129,7 +129,7 @@ catch ( const AssertionFailedError & error ) { - throw AssertionFailedError( __LINE__, __FILE__, + assertionFailed( __LINE__, __FILE__, error.getMessage() + MOCKPP_PCHAR( "\n" ) + this->toString() ); } } Index: ChainingMockBuilder.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/ChainingMockBuilder.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- ChainingMockBuilder.h 27 Feb 2005 11:48:15 -0000 1.23 +++ ChainingMockBuilder.h 28 Aug 2005 20:40:23 -0000 1.24 @@ -151,7 +151,7 @@ { MatchBuilderAdapterBase *tmb = buildernamespace->lookupID(id); if ( tmb == 0 ) - throw AssertionFailedError( __LINE__, __FILE__, + assertionFailed( __LINE__, __FILE__, MOCKPP_PCHAR( "no expected invocation named '" ) + id + MOCKPP_PCHAR( "'" ) ); Index: AbstractDynamicChainingMock.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/AbstractDynamicChainingMock.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- AbstractDynamicChainingMock.h 24 Jul 2005 12:54:00 -0000 1.33 +++ AbstractDynamicChainingMock.h 28 Aug 2005 20:40:23 -0000 1.34 @@ -44,6 +44,8 @@ #include <mockpp/stub/ReturnStub.h> +#include <mockpp/compat/Exception.h> + namespace mockpp { @@ -138,7 +140,7 @@ catch ( const AssertionFailedError &ex ) { - throw AssertionFailedError( __LINE__, __FILE__, + assertionFailed( __LINE__, __FILE__, MOCKPP_PCHAR( "mock object " ) + getMockName() + MOCKPP_PCHAR( ": " ) @@ -248,7 +250,9 @@ virtual R mockInvocation( const I &invocation ) { if ( this->failure.get() != 0 ) - throw *this->failure.get(); + assertionFailed(this->failure->getSrcLine(), + this->failure->getSrcFile(), + this->failure->getMessage()); try { @@ -262,8 +266,11 @@ this->invocationDispatcher.get(), assertion.getMessage() ); this->failure.reset( new AssertionFailedError(__LINE__, __FILE__, dme.getMessage())); - throw *this->failure.get(); + assertionFailed(this->failure->getSrcLine(), + this->failure->getSrcFile(), + this->failure->getMessage()); } + return R(); } }; |