[Mockpp-commits] mockpp/mockpp/chaining AbstractDynamicChainingMock.h,1.23,1.24 CoreMock.h,1.12,1.13
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2005-04-02 20:46:14
|
Update of /cvsroot/mockpp/mockpp/mockpp/chaining In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3635/mockpp/chaining Modified Files: AbstractDynamicChainingMock.h CoreMock.h FIFOInvocationDispatcher.h InvocationMocker.h LIFOInvocationDispatcher.h Log Message: more fixes for msvc6 Index: InvocationMocker.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/InvocationMocker.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- InvocationMocker.h 2 Apr 2005 13:46:29 -0000 1.29 +++ InvocationMocker.h 2 Apr 2005 20:45:31 -0000 1.30 @@ -200,7 +200,7 @@ * @return The current content of the buffer data */ virtual String describeTo( String &result, - const InvocationMockerBase<R,I>::List &matchers, + const typename std::vector<InvocationMatcher<I>*> &matchers, // const InvocationMockerBase<R,I>::List &matchers Stub<R, I> *stub, const String &name ) const = 0; @@ -212,7 +212,7 @@ * @return The current content of the buffer data */ String describeTo( String &result, - const InvocationMockerBase<R,I>::List &matchers, + const typename std::vector<InvocationMatcher<I>*> &matchers, TypelessStub<R>* stub, const String &name ) const { @@ -248,7 +248,7 @@ * @return The current content of the buffer data */ virtual String describeTo( String &result, - const List &matchers, + const typename std::vector<InvocationMatcher<I>*> &matchers, Stub<R, I> *stub, const String &name ) const { @@ -303,7 +303,7 @@ * @return The current content of the buffer data */ String describeTo( String &result, - const List &matchers, + const typename std::vector<InvocationMatcher<I>*> &matchers, Stub<R, I> *stub, const String &name ) const { @@ -441,14 +441,14 @@ */ #define MOCKPP_INVOCATIONMOCKER_PTI_DECL(I) \ template<> \ -::mockpp::InvocationMocker<void, I>::InvocationMocker<void, I>(); \ +::mockpp::InvocationMocker<void, I >::InvocationMocker<void, I >(); \ \ template<> \ -::mockpp::InvocationMocker<void, I>::InvocationMocker<void, I>(\ - ::mockpp::AutoPointer<mockpp::InvocationMockerBase<void, I>::DescriberBase> in_describer ); \ +::mockpp::InvocationMocker<void, I >::InvocationMocker<void, I >(\ + ::mockpp::AutoPointer<mockpp::InvocationMockerBase<void, I >::DescriberBase> in_describer ); \ \ template<> \ -void ::mockpp::InvocationMocker<void, I>::invoke( const I &invocation ); +void ::mockpp::InvocationMocker<void, I >::invoke( const I &invocation ); /** Implement specialized methods for mockpp::InvocationMocker. @@ -456,22 +456,22 @@ */ #define MOCKPP_INVOCATIONMOCKER_PTI_IMPL(I) \ template<> \ -::mockpp::InvocationMocker<void, I>::InvocationMocker<void, I>() \ - : InvocationMockerBase<void, I>( new ::mockpp::InvocationMockerBase<void, I>::DefaultDescriber(), \ - new ::mockpp::TypelessStubAdapter<void, I>(new ::mockpp::VoidStub)) \ +::mockpp::InvocationMocker<void, I >::InvocationMocker<void, I >() \ + : InvocationMockerBase<void, I >( new ::mockpp::InvocationMockerBase<void, I >::DefaultDescriber(), \ + new ::mockpp::TypelessStubAdapter<void, I >(new ::mockpp::VoidStub)) \ { \ } \ \ template<> \ -mockpp::InvocationMocker<void, I>::InvocationMocker<void, I>(\ - ::mockpp::AutoPointer<mockpp::InvocationMockerBase<void, I>::DescriberBase> in_describer ) \ - : InvocationMockerBase<void, I>( in_describer, \ - new ::mockpp::TypelessStubAdapter<void, I>(new ::mockpp::VoidStub)) \ +mockpp::InvocationMocker<void, I >::InvocationMocker<void, I >(\ + ::mockpp::AutoPointer<mockpp::InvocationMockerBase<void, I >::DescriberBase> in_describer ) \ + : InvocationMockerBase<void, I >( in_describer, \ + new ::mockpp::TypelessStubAdapter<void, I >(new ::mockpp::VoidStub)) \ { \ } \ \ template<> \ -void ::mockpp::InvocationMocker<void, I>::invoke( const I &invocation ) \ +void ::mockpp::InvocationMocker<void, I >::invoke( const I &invocation ) \ { \ for ( Iterator it = this->matchers.begin(); it != this->matchers.end(); ++it ) \ ( *it ) ->incInvoked( invocation ); \ Index: CoreMock.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/CoreMock.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- CoreMock.h 25 Mar 2005 16:30:29 -0000 1.12 +++ CoreMock.h 2 Apr 2005 20:45:31 -0000 1.13 @@ -133,14 +133,14 @@ */ #define MOCKPP_COREMOCK_PTI_DECL(I) \ template<> \ -void mockpp::CoreMock<void, I>::invoke( const I &invocation ); +void mockpp::CoreMock<void, I >::invoke( const I &invocation ); /** Implement specialized methods for mockpp::CoreMock. * Neccessary for compiler with weak template capabilities. */ #define MOCKPP_COREMOCK_PTI_IMPL(I) \ template<> \ -void mockpp::CoreMock<void, I>::invoke( const I &invocation ) \ +void mockpp::CoreMock<void, I >::invoke( const I &invocation ) \ { \ mockInvocation( invocation ); \ } Index: LIFOInvocationDispatcher.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/LIFOInvocationDispatcher.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- LIFOInvocationDispatcher.h 25 Mar 2005 16:30:29 -0000 1.11 +++ LIFOInvocationDispatcher.h 2 Apr 2005 20:45:31 -0000 1.12 @@ -115,14 +115,14 @@ */ #define MOCKPP_LIFOINVOCATIONDISPATCHER_PTI_DECL(I) \ template<> \ -void mockpp::LIFOInvocationDispatcher<void, I>::dispatch( const I &invocation ); +void mockpp::LIFOInvocationDispatcher<void, I >::dispatch( const I &invocation ); /** Implement specialized methods for mockpp::LIFOInvocationDispatcher. * Neccessary for compiler with weak template capabilities. */ #define MOCKPP_LIFOINVOCATIONDISPATCHER_PTI_IMPL(I) \ template<> \ -void mockpp::LIFOInvocationDispatcher<void, I>::dispatch( const I &invocation ) \ +void mockpp::LIFOInvocationDispatcher<void, I >::dispatch( const I &invocation ) \ { \ Iterator it = this->invokables.rbegin(); \ Iterator end = this->invokables.rend(); \ Index: AbstractDynamicChainingMock.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/AbstractDynamicChainingMock.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- AbstractDynamicChainingMock.h 25 Mar 2005 16:30:28 -0000 1.23 +++ AbstractDynamicChainingMock.h 2 Apr 2005 20:45:30 -0000 1.24 @@ -82,7 +82,7 @@ return false; } -#if defined(__BORLANDC__) || defined(_MSC_VER) +#if defined(__BORLANDC__) /** Appends the description of this object to the buffer. * @param buffer The buffer that the description is appended to. * @return The current content of the buffer data @@ -92,9 +92,36 @@ return InvocationMocker<R, I>::DescriberBase::describeTo(buffer); } #else - using InvocationMocker<R, I>::DescriberBase::describeTo; +#define MOCKPP_NEED_USING #endif +#if defined(_MSC_VER) + /** Appends the description of this object to the buffer. + * @param result The buffer that the description is appended to. + * @param matchers list of matcher objects + * @param stub pointer to the stub + * @param name name of the object + * @return The current content of the buffer data + */ + String describeTo( String &result, + const typename std::vector<InvocationMatcher<I>*> &matchers, + TypelessStub<R>* stub, + const String &name ) const + { + return InvocationMocker<R, I>::DescriberBase::describeTo( result, + matchers, + stub, + name ); + } +#else +#define MOCKPP_NEED_USING +#endif + +#ifdef MOCKPP_NEED_USING + using InvocationMocker<R, I>::DescriberBase::describeTo; // use only once +#endif +#undef MOCKPP_NEED_USING + /** Appends the description of this object to the buffer. * @param result The buffer that the description is appended to. * @param matchers list of matcher objects @@ -103,7 +130,7 @@ * @return The current content of the buffer data */ virtual String describeTo( String &result, - const typename InvocationMocker<R, I>::List &matchers, + const typename std::vector<InvocationMatcher<I>*> &matchers, Stub<R, I> *stub, const String &name ) const { @@ -323,14 +350,14 @@ */ #define MOCKPP_ABSTRACTDYNAMICCHAININGMOCK_PTI_DECL(I) \ template<> \ -void mockpp::AbstractDynamicChainingMock<void, I>::mockInvocation( const I &invocation ); +void mockpp::AbstractDynamicChainingMock<void, I >::mockInvocation( const I &invocation ); /** Implement specialized methods for mockpp::AbstractDynamicChainingMock. * Neccessary for compiler with weak template capabilities. */ #define MOCKPP_ABSTRACTDYNAMICCHAININGMOCK_PTI_IMPL(I) \ template<> \ -void mockpp::AbstractDynamicChainingMock<void, I>::mockInvocation( const I &invocation ) \ +void mockpp::AbstractDynamicChainingMock<void, I >::mockInvocation( const I &invocation ) \ { \ if ( this->failure.get() != 0 ) \ throw *this->failure.get(); \ @@ -342,10 +369,10 @@ \ catch ( const AssertionFailedError & assertion ) \ { \ - DynamicChainingMockError<void, I> dme( this, \ - invocation, \ - this->invocationDispatcher.get(), \ - assertion.getMessage() ); \ + DynamicChainingMockError<void, I > dme( this, \ + invocation, \ + this->invocationDispatcher.get(), \ + assertion.getMessage() ); \ this->failure.reset( new AssertionFailedError(__LINE__, __FILE__, dme.getMessage())); \ throw *this->failure.get(); \ } \ Index: FIFOInvocationDispatcher.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/chaining/FIFOInvocationDispatcher.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- FIFOInvocationDispatcher.h 25 Mar 2005 16:30:29 -0000 1.11 +++ FIFOInvocationDispatcher.h 2 Apr 2005 20:45:31 -0000 1.12 @@ -115,14 +115,14 @@ */ #define MOCKPP_FIFOINVOCATIONDISPATCHER_PTI_DECL(I) \ template<> \ -void mockpp::FIFOInvocationDispatcher<void, I>::dispatch( const I &invocation ); +void mockpp::FIFOInvocationDispatcher<void, I >::dispatch( const I &invocation ); /** Implement specialized methods for mockpp::FIFOInvocationDispatcher. * Neccessary for compiler with weak template capabilities. */ #define MOCKPP_FIFOINVOCATIONDISPATCHER_PTI_IMPL(I) \ template<> \ -void mockpp::FIFOInvocationDispatcher<void, I>::dispatch( const I &invocation ) \ +void mockpp::FIFOInvocationDispatcher<void, I >::dispatch( const I &invocation ) \ { \ Iterator it = this->invokables.begin(); \ Iterator end = this->invokables.end(); \ |