[Mockpp-commits] mockpp/mockpp VerifyingTestCaller.h,1.10,1.11 VisitableMockMethod0.h,1.11,1.12 Visi
Brought to you by:
ewald-arnold
|
From: Ewald A. <ewa...@us...> - 2005-11-28 19:03:44
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24721/mockpp Modified Files: VerifyingTestCaller.h VisitableMockMethod0.h VisitableMockMethod1.h VisitableMockMethod2.h VisitableMockMethod3.h VisitableMockMethod4.h VisitableMockMethod5.h VisitableMockMethod6.h VisitableMockObject_macro.h gen_visitablemethod_N.pl mockpp.h Log Message: optionally disable exceptions Index: VisitableMockObject_macro.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockObject_macro.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- VisitableMockObject_macro.h 26 Nov 2005 18:00:17 -0000 1.35 +++ VisitableMockObject_macro.h 28 Nov 2005 19:03:09 -0000 1.36 @@ -727,15 +727,15 @@ } \ else \ { \ - try { \ + MOCKPP_TRY { \ addActualMethod(mockpp::getLatin1(getVerifiableName()) + "." + func_name); \ mockpp::Throwable *t; \ if (m_name ## ResponseValues.find(t, (v_type1)param1)) \ t->throw_me(); \ MOCKPP_THROWER_IMPL(m_name); \ - } catch(...) { \ + } MOCKPP_CATCH_ALL { \ m_name ## Parameter1.balanceActual(); \ - throw; \ + MOCKPP_RETHROW; \ } \ m_name ## Parameter1.addActual((v_type1&)param1); \ return; \ @@ -778,16 +778,16 @@ } \ else \ { \ - try { \ + MOCKPP_TRY { \ addActualMethod(mockpp::getLatin1(getVerifiableName()) + "." + func_name); \ mockpp::Throwable *t; \ if (m_name ## ResponseValues.find(t, (v_type1)param1, (v_type2)param2)) \ t->throw_me(); \ MOCKPP_THROWER_IMPL(m_name); \ - } catch(...) { \ + } MOCKPP_CATCH_ALL { \ m_name ## Parameter1.balanceActual(); \ m_name ## Parameter2.balanceActual(); \ - throw; \ + MOCKPP_RETHROW; \ } \ m_name ## Parameter1.addActual((v_type1&)param1); \ m_name ## Parameter2.addActual((v_type2&)param2); \ @@ -836,17 +836,17 @@ } \ else \ { \ - try { \ + MOCKPP_TRY { \ addActualMethod(mockpp::getLatin1(getVerifiableName()) + "." + func_name); \ mockpp::Throwable *t; \ if (m_name ## ResponseValues.find(t, (v_type1)param1, (v_type2)param2, (v_type3)param3)) \ t->throw_me(); \ MOCKPP_THROWER_IMPL(m_name); \ - } catch(...) { \ + } MOCKPP_CATCH_ALL { \ m_name ## Parameter1.balanceActual(); \ m_name ## Parameter2.balanceActual(); \ m_name ## Parameter3.balanceActual(); \ - throw; \ + MOCKPP_RETHROW; \ } \ m_name ## Parameter1.addActual((v_type1&)param1); \ m_name ## Parameter2.addActual((v_type2&)param2); \ @@ -901,18 +901,18 @@ } \ else \ { \ - try { \ + MOCKPP_TRY { \ addActualMethod(mockpp::getLatin1(getVerifiableName()) + "." + func_name); \ mockpp::Throwable *t; \ if (m_name ## ResponseValues.find(t, (v_type1)param1, (v_type2)param2, (v_type3)param3, (v_type4)param4)) \ t->throw_me(); \ MOCKPP_THROWER_IMPL(m_name); \ - } catch(...) { \ + } MOCKPP_CATCH_ALL { \ m_name ## Parameter1.balanceActual(); \ m_name ## Parameter2.balanceActual(); \ m_name ## Parameter3.balanceActual(); \ m_name ## Parameter4.balanceActual(); \ - throw; \ + MOCKPP_RETHROW; \ } \ m_name ## Parameter1.addActual((v_type1&)param1); \ m_name ## Parameter2.addActual((v_type2&)param2); \ @@ -973,19 +973,19 @@ } \ else \ { \ - try { \ + MOCKPP_TRY { \ addActualMethod(mockpp::getLatin1(getVerifiableName()) + "." + func_name); \ mockpp::Throwable *t; \ if (m_name ## ResponseValues.find(t, (v_type1)param1, (v_type2)param2, (v_type3)param3, (v_type4)param4, (v_type5)param5)) \ t->throw_me(); \ MOCKPP_THROWER_IMPL(m_name); \ - } catch(...) { \ + } MOCKPP_CATCH_ALL { \ m_name ## Parameter1.balanceActual(); \ m_name ## Parameter2.balanceActual(); \ m_name ## Parameter3.balanceActual(); \ m_name ## Parameter4.balanceActual(); \ m_name ## Parameter5.balanceActual(); \ - throw; \ + MOCKPP_RETHROW; \ } \ m_name ## Parameter1.addActual((v_type1&)param1); \ m_name ## Parameter2.addActual((v_type2&)param2); \ @@ -1077,15 +1077,15 @@ } \ else \ { \ - try { \ + MOCKPP_TRY { \ addActualMethod(mockpp::getLatin1(getVerifiableName()) + "." + func_name); \ mockpp::Throwable *t; \ if (m_name ## ResponseValues.find(t, (v_type1)param1)) \ t->throw_me(); \ MOCKPP_THROWER_IMPL(m_name); \ - } catch(...) { \ + } MOCKPP_CATCH_ALL { \ m_name ## Parameter1.balanceActual(); \ - throw; \ + MOCKPP_RETHROW; \ } \ m_name ## Parameter1.addActual((v_type1&)param1); \ \ @@ -1141,16 +1141,16 @@ } \ else \ { \ - try { \ + MOCKPP_TRY { \ addActualMethod(mockpp::getLatin1(getVerifiableName()) + "." + func_name); \ mockpp::Throwable *t; \ if (m_name ## ResponseValues.find(t, (v_type1)param1, (v_type2)param2)) \ t->throw_me(); \ MOCKPP_THROWER_IMPL(m_name); \ - } catch(...) { \ + } MOCKPP_CATCH_ALL { \ m_name ## Parameter1.balanceActual(); \ m_name ## Parameter2.balanceActual(); \ - throw; \ + MOCKPP_RETHROW; \ } \ \ m_name ## Parameter1.addActual((v_type1&)param1); \ @@ -1212,17 +1212,17 @@ } \ else \ { \ - try { \ + MOCKPP_TRY { \ addActualMethod(mockpp::getLatin1(getVerifiableName()) + "." + func_name); \ mockpp::Throwable *t; \ if (m_name ## ResponseValues.find(t, (v_type1)param1, (v_type2)param2, (v_type3)param3)) \ t->throw_me(); \ MOCKPP_THROWER_IMPL(m_name); \ - } catch(...) { \ + } MOCKPP_CATCH_ALL { \ m_name ## Parameter1.balanceActual(); \ m_name ## Parameter2.balanceActual(); \ m_name ## Parameter3.balanceActual(); \ - throw; \ + MOCKPP_RETHROW; \ } \ \ m_name ## Parameter1.addActual((v_type1&)param1); \ @@ -1289,18 +1289,18 @@ } \ else \ { \ - try { \ + MOCKPP_TRY { \ addActualMethod(mockpp::getLatin1(getVerifiableName()) + "." + func_name); \ mockpp::Throwable *t; \ if (m_name ## ResponseValues.find(t, (v_type1)param1, (v_type2)param2, (v_type3)param3, (v_type4)param4)) \ t->throw_me(); \ MOCKPP_THROWER_IMPL(m_name); \ - } catch(...) { \ + } MOCKPP_CATCH_ALL { \ m_name ## Parameter1.balanceActual(); \ m_name ## Parameter2.balanceActual(); \ m_name ## Parameter3.balanceActual(); \ m_name ## Parameter4.balanceActual(); \ - throw; \ + MOCKPP_RETHROW; \ } \ \ m_name ## Parameter1.addActual((v_type1&)param1); \ @@ -1373,19 +1373,19 @@ } \ else \ { \ - try { \ + MOCKPP_TRY { \ addActualMethod(mockpp::getLatin1(getVerifiableName()) + "." + func_name); \ mockpp::Throwable *t; \ if (m_name ## ResponseValues.find(t, (v_type1)param1, (v_type2)param2, (v_type3)param3, (v_type4)param4, (v_type5)param5)) \ t->throw_me(); \ MOCKPP_THROWER_IMPL(m_name); \ - } catch(...) { \ + } MOCKPP_CATCH_ALL { \ m_name ## Parameter1.balanceActual(); \ m_name ## Parameter2.balanceActual(); \ m_name ## Parameter3.balanceActual(); \ m_name ## Parameter4.balanceActual(); \ m_name ## Parameter5.balanceActual(); \ - throw; \ + MOCKPP_RETHROW; \ } \ \ m_name ## Parameter1.addActual((v_type1&)param1); \ Index: VisitableMockMethod6.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod6.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- VisitableMockMethod6.h 19 Nov 2005 14:16:38 -0000 1.9 +++ VisitableMockMethod6.h 28 Nov 2005 19:03:09 -0000 1.10 @@ -129,7 +129,7 @@ parameter4.balanceActual(); parameter5.balanceActual(); parameter6.balanceActual(); - throw; + MOCKPP_RETHROW; } parameter1.addActual(p1); Index: VisitableMockMethod2.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod2.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- VisitableMockMethod2.h 19 Nov 2005 14:16:38 -0000 1.11 +++ VisitableMockMethod2.h 28 Nov 2005 19:03:09 -0000 1.12 @@ -105,7 +105,7 @@ { parameter1.balanceActual(); parameter2.balanceActual(); - throw; + MOCKPP_RETHROW; } parameter1.addActual(p1); Index: VerifyingTestCaller.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VerifyingTestCaller.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- VerifyingTestCaller.h 26 Nov 2005 18:00:17 -0000 1.10 +++ VerifyingTestCaller.h 28 Nov 2005 19:03:09 -0000 1.11 @@ -93,18 +93,20 @@ virtual void runTest() { testcase->unregisterVerifiables(); - try + MOCKPP_TRY { - ::CppUnit::TestCaller<VerifyingFixtureType>::runTest(); + ::CppUnit::TestCaller<VerifyingFixtureType>::runTest(); bool doVerify = DoTheVerify; if (doVerify) testcase->verify(); } +#ifndef MOCKPP_NO_EXCEPTIONS catch(...) { testcase->unregisterVerifiables(); - throw; + MOCKPP_RETHROW; } +#endif testcase->unregisterVerifiables(); } Index: gen_visitablemethod_N.pl =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/gen_visitablemethod_N.pl,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- gen_visitablemethod_N.pl 19 Nov 2005 14:16:38 -0000 1.13 +++ gen_visitablemethod_N.pl 28 Nov 2005 19:03:09 -0000 1.14 @@ -259,7 +259,7 @@ parameter" . $p . ".balanceActual();"; } print OUT " - throw; + MOCKPP_RETHROW; } "; Index: VisitableMockMethod3.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod3.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- VisitableMockMethod3.h 19 Nov 2005 14:16:38 -0000 1.11 +++ VisitableMockMethod3.h 28 Nov 2005 19:03:09 -0000 1.12 @@ -111,7 +111,7 @@ parameter1.balanceActual(); parameter2.balanceActual(); parameter3.balanceActual(); - throw; + MOCKPP_RETHROW; } parameter1.addActual(p1); Index: mockpp.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/mockpp.h,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- mockpp.h 27 Nov 2005 17:27:56 -0000 1.62 +++ mockpp.h 28 Nov 2005 19:03:09 -0000 1.63 @@ -201,8 +201,10 @@ #ifndef MOCKPP_NO_EXCEPTIONS #define MOCKPP_THROW(x) throw (x) +#define MOCKPP_RETHROW throw #define MOCKPP_TRY try #define MOCKPP_CATCH(x) (x) +#define MOCKPP_CATCH_ALL catch(...) #else @@ -212,6 +214,10 @@ # define MOCKPP_THROW(x) /**/ # endif +# ifndef MOCKPP_RETHROW +# define MOCKPP_RETHROW /**/ +# endif + # ifndef MOCKPP_TRY # define MOCKPP_TRY /**/ # endif @@ -220,6 +226,10 @@ # define MOCKPP_CATCH(x) if(false) # endif +# ifndef MOCKPP_CATCH_ALL +# define MOCKPP_CATCH_ALL +# endif + #endif ////////////////////////////////////////////////// Index: VisitableMockMethod4.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod4.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- VisitableMockMethod4.h 19 Nov 2005 14:16:38 -0000 1.11 +++ VisitableMockMethod4.h 28 Nov 2005 19:03:09 -0000 1.12 @@ -117,7 +117,7 @@ parameter2.balanceActual(); parameter3.balanceActual(); parameter4.balanceActual(); - throw; + MOCKPP_RETHROW; } parameter1.addActual(p1); Index: VisitableMockMethod5.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod5.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- VisitableMockMethod5.h 19 Nov 2005 14:16:38 -0000 1.11 +++ VisitableMockMethod5.h 28 Nov 2005 19:03:09 -0000 1.12 @@ -123,7 +123,7 @@ parameter3.balanceActual(); parameter4.balanceActual(); parameter5.balanceActual(); - throw; + MOCKPP_RETHROW; } parameter1.addActual(p1); Index: VisitableMockMethod1.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod1.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- VisitableMockMethod1.h 19 Nov 2005 14:16:38 -0000 1.11 +++ VisitableMockMethod1.h 28 Nov 2005 19:03:09 -0000 1.12 @@ -99,7 +99,7 @@ catch(...) { parameter1.balanceActual(); - throw; + MOCKPP_RETHROW; } parameter1.addActual(p1); |