Thread: [Mockpp-commits] mockpp/mockpp/tests AbstractDynamicChainingMock_test.cpp,1.41,1.42 AbstractInvocati
Brought to you by:
ewald-arnold
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv763/mockpp/tests Modified Files: AbstractDynamicChainingMock_test.cpp AbstractInvocationDispatcher_test.cpp And_test.cpp AnyArgumentsMatcher_test.cpp ArgumentsMatchBuilder_test.cpp ArgumentsMatcher_test.cpp AssertMo_test.cpp Assert_test.cpp ChainableMockMethod_1_test.cpp ChainableMockMethod_2_test.cpp ChainableMockMethod_test.cpp ChainableMockObjectPolymorphism_test.cpp ChainableMockObject_1_test.cpp ChainableMockObject_1_void_test.cpp ChainableMockObject_2_test.cpp ChainableMockObject_2_void_test.cpp ChainableMockObject_3_test.cpp ChainableMockObject_3_void_test.cpp ChainableMockObject_4_test.cpp ChainableMockObject_4_void_test.cpp ChainableMockObject_5_test.cpp ChainableMockObject_5_void_test.cpp ChainableMockObject_test.cpp ChainableMockObject_void_test.cpp ChainingMockBuilder_test.cpp ChainingMockObjectSupport_test.cpp ConstraintList_test.cpp ConstraintSet_test.cpp CoreMock_test.cpp CustomStub_test.cpp DefaultResultStub_test.cpp DynamicChainingMockError_test.cpp Exception_test.cpp ExpectationBoundary_test.cpp ExpectationConglomeration_test.cpp ExpectationCounterRange_test.cpp ExpectationCounter_test.cpp ExpectationList_test.cpp ExpectationMap_test.cpp ExpectationSegment_test.cpp ExpectationSet_test.cpp ExpectationValue_test.cpp FIFOInvocationDispatcher_test.cpp Formatter_test.cpp IncCounter.h InvocationMockerBuilder_test.cpp InvocationMocker_test.cpp Invocation_test.cpp InvokeAtLeastMatcher_test.cpp InvokeAtLeastOnceMatcher_test.cpp InvokeAtMostMatcher_test.cpp InvokeCountMatcher_test.cpp InvokeOnceMatcher_test.cpp InvokedAfterMatcher_test.cpp InvokedBeforeMatcher_test.cpp InvokedRecorder_test.cpp IsAnything_test.cpp IsCloseTo_test.cpp IsEqual_test.cpp IsGreaterOrEqual_test.cpp IsGreaterThan_test.cpp IsInstanceOf_test.cpp IsLessOrEqual_test.cpp IsLessThan_test.cpp IsNot_test.cpp IsNothing_test.cpp IsSame_test.cpp LIFOInvocationDispatcher_test.cpp MatchBuilder_test.cpp MixedMockObject_5_test.cpp MockObject_test.cpp MyBuilderNamespace.h MyMatchBuilder.h NoArgumentsMatcher_test.cpp NoException_test.cpp Or_test.cpp OutBound_test.cpp ResponseVector_test.cpp ReturnObjectList_test.cpp ReturnStub_test.cpp StringContains_test.cpp StringEndsWith_test.cpp StringStartsWith_test.cpp StubBuilder_test.cpp StubSequence_test.cpp TestFailureMatcher_test.cpp TestFailureStub_test.cpp ThrowStub_test.cpp ThrowableList_test.cpp Throwable_test.cpp TimeServer_test.cpp TrackingCounter_test.cpp TypelessStubSequence_test.cpp UnlimitedMatcher_test.cpp Verifiable_test.cpp VerifyingTestCaller_test.cpp VerifyingTestCase_test.cpp VisitableMockMethod_1_test.cpp VisitableMockMethod_2_test.cpp VisitableMockMethod_test.cpp VisitableMockObject_1_test.cpp VisitableMockObject_1_void_test.cpp VisitableMockObject_2_test.cpp VisitableMockObject_2_void_test.cpp VisitableMockObject_3_test.cpp VisitableMockObject_3_void_test.cpp VisitableMockObject_4_test.cpp VisitableMockObject_4_void_test.cpp VisitableMockObject_5_test.cpp VisitableMockObject_5_void_test.cpp VisitableMockObject_template_test.cpp VisitableMockObject_test.cpp VisitableMockObject_void_test.cpp VoidStub_test.cpp classes_ABCDE.cpp classes_ABCDE.h compilecheck.cpp mock_test.cpp mockpp_pti_test.cpp mockpp_test.cpp readability_test.cpp Log Message: optionally disable mockpp namespace Index: readability_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/readability_test.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- readability_test.cpp 29 Dec 2005 19:29:52 -0000 1.6 +++ readability_test.cpp 15 Mar 2006 21:34:08 -0000 1.7 @@ -41,12 +41,12 @@ #include "classes_ABCDE.h" -class MyMixedMockObject : public mockpp::MixedMockObject +class MyMixedMockObject : public MOCKPP_NS::MixedMockObject { public: MyMixedMockObject() - : mockpp::MixedMockObject(MOCKPP_PCHAR("MyMixedMockObjectInstance") , 0) + : MOCKPP_NS::MixedMockObject(MOCKPP_PCHAR("MyMixedMockObjectInstance") , 0) , MOCKPP_CONSTRUCT_MEMBERS_FOR_CHAINABLE5(chain) , MOCKPP_CONSTRUCT_MEMBERS_FOR_VISITABLE5(visit) , MOCKPP_CONSTRUCT_MEMBERS_FOR_VOID_CHAINABLE5(void_chain) @@ -141,7 +141,7 @@ void constraintlist_1() { - mockpp::ConstraintList<MOCKPP_STL::string> list(MOCKPP_PCHAR("ConstraintListInstance")); + MOCKPP_NS::ConstraintList<MOCKPP_STL::string> list(MOCKPP_PCHAR("ConstraintListInstance")); list.addExpected(eq(MOCKPP_STL::string("string"))); MOCKPP_TRY { @@ -158,7 +158,7 @@ void expectationlist_1() { - mockpp::ExpectationList<MOCKPP_STL::string> list(MOCKPP_PCHAR("ExpectationListInstance")); + MOCKPP_NS::ExpectationList<MOCKPP_STL::string> list(MOCKPP_PCHAR("ExpectationListInstance")); list.addExpected(MOCKPP_STL::string("string")); MOCKPP_TRY { @@ -175,7 +175,7 @@ void expectationlist_2() { - mockpp::ExpectationList<MOCKPP_STL::string> list(MOCKPP_PCHAR("ExpectationListInstance") ); + MOCKPP_NS::ExpectationList<MOCKPP_STL::string> list(MOCKPP_PCHAR("ExpectationListInstance") ); list.addExpected(MOCKPP_STL::string("string")); list.addActual(MOCKPP_STL::string("string")); MOCKPP_TRY Index: Or_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/Or_test.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Or_test.cpp 1 Jan 2006 16:34:48 -0000 1.19 +++ Or_test.cpp 15 Mar 2006 21:34:08 -0000 1.20 @@ -86,9 +86,9 @@ void Or_test::test_describe() { - mockpp::Or<bool> or1 (new mockpp::IsAnything, - new mockpp::IsNothing); - mockpp::String s = MOCKPP_PCHAR("or1?"); + MOCKPP_NS::Or<bool> or1 (new MOCKPP_NS::IsAnything, + new MOCKPP_NS::IsNothing); + MOCKPP_NS::String s = MOCKPP_PCHAR("or1?"); MOCKPP_ASSERT_TRUE(or1.describeTo(s) == MOCKPP_PCHAR("or1?(ANYTHING || NOTHING)")); MOCKPP_ASSERT_TRUE(s == MOCKPP_PCHAR("or1?(ANYTHING || NOTHING)")); } @@ -96,8 +96,8 @@ void Or_test::test_invoke() { - mockpp::Or<int> or1 (new mockpp::IsEqual<int>(1), - new mockpp::IsEqual<int>(5)); + MOCKPP_NS::Or<int> or1 (new MOCKPP_NS::IsEqual<int>(1), + new MOCKPP_NS::IsEqual<int>(5)); MOCKPP_ASSERT_TRUE(or1.eval(1) == true); MOCKPP_ASSERT_TRUE(or1.eval(2) == false); MOCKPP_ASSERT_TRUE(or1.eval(4) == false); Index: TestFailureMatcher_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/TestFailureMatcher_test.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- TestFailureMatcher_test.cpp 1 Jan 2006 16:34:48 -0000 1.17 +++ TestFailureMatcher_test.cpp 15 Mar 2006 21:34:08 -0000 1.18 @@ -78,7 +78,7 @@ void TestFailureMatcher_test::test_invoke() { - mockpp::TestFailureMatcher tfm (MOCKPP_PCHAR("knorxi")); + MOCKPP_NS::TestFailureMatcher tfm (MOCKPP_PCHAR("knorxi")); MOCKPP_TRY { @@ -87,10 +87,10 @@ } #ifndef MOCKPP_NO_EXCEPTIONS - catch(mockpp::AssertionFailedError &x) + catch(MOCKPP_NS::AssertionFailedError &x) { MOCKPP_ASSERT_TRUE(x.getMessage().find(MOCKPP_PCHAR("knorxi")) - != mockpp::String::npos); + != MOCKPP_NS::String::npos); } catch(...) @@ -99,7 +99,7 @@ } #endif - mockpp::String s = MOCKPP_PCHAR("hallo"); + MOCKPP_NS::String s = MOCKPP_PCHAR("hallo"); MOCKPP_ASSERT_TRUE(tfm.describeTo(s) == MOCKPP_PCHAR("halloknorxi")); MOCKPP_ASSERT_TRUE(s == MOCKPP_PCHAR("halloknorxi")); Index: DynamicChainingMockError_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/DynamicChainingMockError_test.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- DynamicChainingMockError_test.cpp 1 Jan 2006 16:34:47 -0000 1.22 +++ DynamicChainingMockError_test.cpp 15 Mar 2006 21:34:08 -0000 1.23 @@ -40,7 +40,7 @@ -namespace { +MOCKPP_ANON_NS_START class DynamicChainingMockError_test MOCKPP_DERIVE_PUBLIC_UNITFRAMEWORK @@ -84,7 +84,7 @@ template <typename R, typename I> -class AID : public mockpp::AbstractInvocationDispatcher<R, I> +class AID : public MOCKPP_NS::AbstractInvocationDispatcher<R, I> { public: @@ -99,30 +99,30 @@ void DynamicChainingMockError_test::test_describe() { - typedef mockpp::Invocation0 SetterInvocation; + typedef MOCKPP_NS::Invocation0 SetterInvocation; - mockpp::AbstractDynamicChainingMock<int, SetterInvocation> - adc (new mockpp::LIFOInvocationDispatcher<int, SetterInvocation>, MOCKPP_PCHAR("adcm-name"), 0); + MOCKPP_NS::AbstractDynamicChainingMock<int, SetterInvocation> + adc (new MOCKPP_NS::LIFOInvocationDispatcher<int, SetterInvocation>, MOCKPP_PCHAR("adcm-name"), 0); SetterInvocation invoc(MOCKPP_PCHAR("InvocationDummy::setProp")); AID<int, SetterInvocation> dispatcher; - mockpp::DynamicChainingMockError<int, SetterInvocation> + MOCKPP_NS::DynamicChainingMockError<int, SetterInvocation> dcme (&adc, invoc, &dispatcher, MOCKPP_PCHAR("error-description") ); - mockpp::String ref (MOCKPP_PCHAR("adcm-name: error-description\n") + MOCKPP_NS::String ref (MOCKPP_PCHAR("adcm-name: error-description\n") MOCKPP_PCHAR("Invoked: InvocationDummy::setProp()\n") MOCKPP_PCHAR("Allowed: ") MOCKPP_PCHAR("no expectations set")); MOCKPP_ASSERT_TRUE(dcme.getMessage() == ref); - mockpp::String s; + MOCKPP_NS::String s; MOCKPP_ASSERT_TRUE(dcme.writeTo(s) == ref); MOCKPP_ASSERT_TRUE(s == ref); } -} // namespace +MOCKPP_NS_END Index: AbstractDynamicChainingMock_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/AbstractDynamicChainingMock_test.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- AbstractDynamicChainingMock_test.cpp 1 Jan 2006 16:34:47 -0000 1.41 +++ AbstractDynamicChainingMock_test.cpp 15 Mar 2006 21:34:08 -0000 1.42 @@ -44,15 +44,15 @@ -typedef mockpp::Invocation0 GetterInvocation; -typedef mockpp::Invocation0 VoidInvocation; -typedef mockpp::ConstraintSet1<int> CSet1; +typedef MOCKPP_NS::Invocation0 GetterInvocation; +typedef MOCKPP_NS::Invocation0 VoidInvocation; +typedef MOCKPP_NS::ConstraintSet1<int> CSet1; MOCKPP_INVOCATIONMOCKER_PTI_IMPL(VoidInvocation) -namespace { +MOCKPP_ANON_NS_START class AbstractDynamicChainingMock_test MOCKPP_DERIVE_PUBLIC_UNITFRAMEWORK @@ -118,14 +118,14 @@ template <typename R, // Returntype typename I> // Invocation -class ChainingMockDummy : public mockpp::AbstractDynamicChainingMock<R, I> +class ChainingMockDummy : public MOCKPP_NS::AbstractDynamicChainingMock<R, I> { public: - ChainingMockDummy( typename mockpp::InvocationDispatcher<R, I>::AP invocationDispatcher, - const mockpp::String &name, - mockpp::VerifiableList *parent ) - : mockpp::AbstractDynamicChainingMock<R,I>(invocationDispatcher, name, parent) + ChainingMockDummy( typename MOCKPP_NS::InvocationDispatcher<R, I>::AP invocationDispatcher, + const MOCKPP_NS::String &name, + MOCKPP_NS::VerifiableList *parent ) + : MOCKPP_NS::AbstractDynamicChainingMock<R,I>(invocationDispatcher, name, parent) {} R invoke(const I &invocation) @@ -141,13 +141,13 @@ template <typename I> // Invocation -class MatcherDummy : public mockpp::Invokable<int, I> +class MatcherDummy : public MOCKPP_NS::Invokable<int, I> { public: bool match_result; int invocation_result; - mockpp::String describe_value; + MOCKPP_NS::String describe_value; bool enable_except; bool is_invoke; // @@ -165,7 +165,7 @@ is_invoke = true; if (enable_except) - mockpp::assertionFailed(__LINE__, __FILE__, MOCKPP_PCHAR("invoke-fail")); + MOCKPP_NS::assertionFailed(__LINE__, __FILE__, MOCKPP_PCHAR("invoke-fail")); return invocation_result; } @@ -173,10 +173,10 @@ virtual void verify() { if (enable_except) - mockpp::assertionFailed(__LINE__, __FILE__, MOCKPP_PCHAR("dummy-verify")); + MOCKPP_NS::assertionFailed(__LINE__, __FILE__, MOCKPP_PCHAR("dummy-verify")); } - virtual mockpp::String describeTo (mockpp::String &buffer) const + virtual MOCKPP_NS::String describeTo (MOCKPP_NS::String &buffer) const { buffer += describe_value; return buffer; @@ -190,13 +190,13 @@ template <typename I> // Invocation -class VoidMatcherDummy : public mockpp::Invokable<void, I> +class VoidMatcherDummy : public MOCKPP_NS::Invokable<void, I> { public: bool match_result; bool is_invoke; - mockpp::String describe_value; + MOCKPP_NS::String describe_value; bool enable_except; virtual bool matches( const I &/*invocation*/ ) @@ -213,17 +213,17 @@ is_invoke = true; if (enable_except) - mockpp::assertionFailed(__LINE__, __FILE__, MOCKPP_PCHAR("invoke-fail")); + MOCKPP_NS::assertionFailed(__LINE__, __FILE__, MOCKPP_PCHAR("invoke-fail")); } virtual void verify() { if (enable_except) - mockpp::assertionFailed(__LINE__, __FILE__, MOCKPP_PCHAR("dummy-verify")); + MOCKPP_NS::assertionFailed(__LINE__, __FILE__, MOCKPP_PCHAR("dummy-verify")); } - virtual mockpp::String describeTo (mockpp::String &buffer) const + virtual MOCKPP_NS::String describeTo (MOCKPP_NS::String &buffer) const { buffer += describe_value; return buffer; @@ -240,27 +240,27 @@ void AbstractDynamicChainingMock_test::test_describer() { #if !defined(__BORLANDC__) && ((__GNUC__ >= 3) /* || defined(_MSC_VER) */) // @todo make compiling - mockpp::AbstractDynamicChainingMock<int, GetterInvocation>::Describer desc; + MOCKPP_NS::AbstractDynamicChainingMock<int, GetterInvocation>::Describer desc; MOCKPP_ASSERT_TRUE(desc.hasDescription() == false); - mockpp::String s; - mockpp::InvocationMocker<int, GetterInvocation>::List matchers; + MOCKPP_NS::String s; + MOCKPP_NS::InvocationMocker<int, GetterInvocation>::List matchers; MOCKPP_ASSERT_TRUE(desc.describeTo(s, matchers, - mockpp::returnValue<int>(1).get(), - mockpp::String(MOCKPP_PCHAR("name")) ) == MOCKPP_PCHAR("") ); + MOCKPP_NS::returnValue<int>(1).get(), + MOCKPP_NS::String(MOCKPP_PCHAR("name")) ) == MOCKPP_PCHAR("") ); #endif } void AbstractDynamicChainingMock_test::test_describe() { - mockpp::AbstractDynamicChainingMock<int, GetterInvocation> + MOCKPP_NS::AbstractDynamicChainingMock<int, GetterInvocation> adc_default ( MOCKPP_PCHAR( "adc-name" ), 0 ); - mockpp::AbstractDynamicChainingMock<int, GetterInvocation> - adc ( new mockpp::LIFOInvocationDispatcher<int, GetterInvocation>, MOCKPP_PCHAR( "adc-name" ), 0 ); + MOCKPP_NS::AbstractDynamicChainingMock<int, GetterInvocation> + adc ( new MOCKPP_NS::LIFOInvocationDispatcher<int, GetterInvocation>, MOCKPP_PCHAR( "adc-name" ), 0 ); MOCKPP_ASSERT_TRUE( adc.toString() == MOCKPP_PCHAR( "adc-name" ) ); MOCKPP_ASSERT_TRUE( adc.getMockName() == MOCKPP_PCHAR( "adc-name" ) ); @@ -269,11 +269,11 @@ void AbstractDynamicChainingMock_test::test_void_describe() { - mockpp::AbstractDynamicChainingMock<void, VoidInvocation> + MOCKPP_NS::AbstractDynamicChainingMock<void, VoidInvocation> adc_default ( MOCKPP_PCHAR( "adc-name" ), 0 ); - mockpp::AbstractDynamicChainingMock<void, VoidInvocation> - adc ( new mockpp::LIFOInvocationDispatcher<void, VoidInvocation>, MOCKPP_PCHAR( "adc-name" ), 0 ); + MOCKPP_NS::AbstractDynamicChainingMock<void, VoidInvocation> + adc ( new MOCKPP_NS::LIFOInvocationDispatcher<void, VoidInvocation>, MOCKPP_PCHAR( "adc-name" ), 0 ); MOCKPP_ASSERT_TRUE( adc.toString() == MOCKPP_PCHAR( "adc-name" ) ); MOCKPP_ASSERT_TRUE( adc.getMockName() == MOCKPP_PCHAR( "adc-name" ) ); @@ -283,7 +283,7 @@ void AbstractDynamicChainingMock_test::test_verify() { ChainingMockDummy<int, GetterInvocation> - cmd (new mockpp::LIFOInvocationDispatcher<int, GetterInvocation>, MOCKPP_PCHAR( "adc-name" ), 0 ); + cmd (new MOCKPP_NS::LIFOInvocationDispatcher<int, GetterInvocation>, MOCKPP_PCHAR( "adc-name" ), 0 ); MatcherDummy<GetterInvocation> *md1 = new MatcherDummy<GetterInvocation>; cmd.addInvokable(md1); @@ -298,10 +298,10 @@ MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("did not throw the exception"), false); } #ifndef MOCKPP_NO_EXCEPTIONS - catch (mockpp::AssertionFailedError &ex ) + catch (MOCKPP_NS::AssertionFailedError &ex ) { - MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("dummy-verify")) != mockpp::String::npos ); - MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != mockpp::String::npos ); + MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("dummy-verify")) != MOCKPP_NS::String::npos ); + MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != MOCKPP_NS::String::npos ); } #endif md1->enable_except = false; @@ -312,7 +312,7 @@ void AbstractDynamicChainingMock_test::test_invocation() { ChainingMockDummy<int, GetterInvocation> - cmd ( new mockpp::LIFOInvocationDispatcher<int, GetterInvocation>, MOCKPP_PCHAR( "adc-name" ), 0 ); + cmd ( new MOCKPP_NS::LIFOInvocationDispatcher<int, GetterInvocation>, MOCKPP_PCHAR( "adc-name" ), 0 ); GetterInvocation inv(MOCKPP_PCHAR("GetterInvocation")); @@ -320,7 +320,7 @@ md1->invocation_result = 10; md1->enable_except = false; cmd.addInvokable(md1); - cmd.setDefaultStub(mockpp::returnValue<int>(33)); + cmd.setDefaultStub(MOCKPP_NS::returnValue<int>(33)); md1->match_result = false; MOCKPP_ASSERT_TRUE(cmd.invoke(inv) == 33); @@ -343,10 +343,10 @@ MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("did not throw the exception"), false); } #ifndef MOCKPP_NO_EXCEPTIONS - catch (mockpp::AssertionFailedError &ex ) + catch (MOCKPP_NS::AssertionFailedError &ex ) { - MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("invoke-fail")) != mockpp::String::npos ); - MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != mockpp::String::npos ); + MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("invoke-fail")) != MOCKPP_NS::String::npos ); + MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != MOCKPP_NS::String::npos ); } #endif @@ -357,10 +357,10 @@ MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("did not throw the exception"), false); } #ifndef MOCKPP_NO_EXCEPTIONS - catch (mockpp::AssertionFailedError &ex ) + catch (MOCKPP_NS::AssertionFailedError &ex ) { - MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("invoke-fail")) != mockpp::String::npos ); - MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != mockpp::String::npos ); + MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("invoke-fail")) != MOCKPP_NS::String::npos ); + MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != MOCKPP_NS::String::npos ); } #endif @@ -370,7 +370,7 @@ template <typename I> // Invocation -class StoreStub : public mockpp::Stub<void, I> +class StoreStub : public MOCKPP_NS::Stub<void, I> { public: @@ -381,7 +381,7 @@ invoked = true; } - virtual mockpp::String describeTo( mockpp::String &buffer ) const + virtual MOCKPP_NS::String describeTo( MOCKPP_NS::String &buffer ) const { return buffer; } @@ -391,7 +391,7 @@ void AbstractDynamicChainingMock_test::test_void_invocation() { ChainingMockDummy<void, VoidInvocation> - cmd ( new mockpp::LIFOInvocationDispatcher<void, VoidInvocation>, MOCKPP_PCHAR( "adc-name" ), 0 ); + cmd ( new MOCKPP_NS::LIFOInvocationDispatcher<void, VoidInvocation>, MOCKPP_PCHAR( "adc-name" ), 0 ); VoidInvocation inv(MOCKPP_PCHAR("VoidInvocation")); @@ -420,11 +420,11 @@ MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("did not throw the exception"), false); } #ifndef MOCKPP_NO_EXCEPTIONS - catch (mockpp::AssertionFailedError &ex ) + catch (MOCKPP_NS::AssertionFailedError &ex ) { - mockpp::String s = ex.getMessage(); - MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("invoke-fail")) != mockpp::String::npos ); - MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("adc-name")) != mockpp::String::npos ); + MOCKPP_NS::String s = ex.getMessage(); + MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("invoke-fail")) != MOCKPP_NS::String::npos ); + MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("adc-name")) != MOCKPP_NS::String::npos ); } #endif @@ -435,10 +435,10 @@ MOCKPP_ASSERT_TRUE_MESSAGE(MOCKPP_PCHAR("did not throw the exception"), false); } #ifndef MOCKPP_NO_EXCEPTIONS - catch (mockpp::AssertionFailedError &ex ) + catch (MOCKPP_NS::AssertionFailedError &ex ) { - MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("invoke-fail")) != mockpp::String::npos ); - MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != mockpp::String::npos ); + MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("invoke-fail")) != MOCKPP_NS::String::npos ); + MOCKPP_ASSERT_TRUE(ex.getMessage().find(MOCKPP_PCHAR("adc-name")) != MOCKPP_NS::String::npos ); } #endif @@ -447,7 +447,7 @@ } -} // namesspace +MOCKPP_NS_END Index: IsInstanceOf_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/IsInstanceOf_test.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- IsInstanceOf_test.cpp 1 Jan 2006 16:34:48 -0000 1.23 +++ IsInstanceOf_test.cpp 15 Mar 2006 21:34:08 -0000 1.24 @@ -124,8 +124,8 @@ void IsInstanceOf_test::test_describe() { - mockpp::IsInstanceOf<A, B> instance; - mockpp::String s = MOCKPP_PCHAR("instance?"); + MOCKPP_NS::IsInstanceOf<A, B> instance; + MOCKPP_NS::String s = MOCKPP_PCHAR("instance?"); MOCKPP_ASSERT_TRUE(instance.describeTo(s).find(MOCKPP_PCHAR("instance?derived from ")) == 0); MOCKPP_ASSERT_TRUE(s.find(MOCKPP_PCHAR("instance?derived from ")) == 0); } @@ -138,7 +138,7 @@ A *pc = new C; A *pd = (A*)new D; - mockpp::IsInstanceOf<A, B> instance; + MOCKPP_NS::IsInstanceOf<A, B> instance; MOCKPP_ASSERT_TRUE(instance.eval((B*)pa) == false); MOCKPP_ASSERT_TRUE(instance.eval(pb) == true); Index: ExpectationList_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ExpectationList_test.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- ExpectationList_test.cpp 1 Jan 2006 16:34:47 -0000 1.25 +++ ExpectationList_test.cpp 15 Mar 2006 21:34:08 -0000 1.26 @@ -155,7 +155,7 @@ void ExpectationList_test::test_chain() { int exp_prep[10] = { 0, 1 }; - mockpp::ExpectationList<int> ab (MOCKPP_PCHAR("testExpectationList"), 0); + MOCKPP_NS::ExpectationList<int> ab (MOCKPP_PCHAR("testExpectationList"), 0); ab.addExpected(200) .addExpected(exp_prep+0, exp_prep+2) @@ -171,7 +171,7 @@ void ExpectationList_test::test_name() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("testList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("testList"), 0); MOCKPP_ASSERT_TRUE(ec.getVerifiableName() == (MOCKPP_PCHAR("testList"))); } @@ -179,13 +179,13 @@ void ExpectationList_test::test_hasExpectations() { { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("testList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("testList"), 0); MOCKPP_ASSERT_TRUE(false == ec.hasExpectations()); ec.addExpected(2); MOCKPP_ASSERT_TRUE(true == ec.hasExpectations()); } - mockpp::ExpectationList<int> ec2 (MOCKPP_PCHAR("testList"), 0); + MOCKPP_NS::ExpectationList<int> ec2 (MOCKPP_PCHAR("testList"), 0); MOCKPP_ASSERT_TRUE(false == ec2.hasExpectations()); ec2.setExpectNothing(); MOCKPP_ASSERT_TRUE(true == ec2.hasExpectations()); @@ -194,7 +194,7 @@ void ExpectationList_test::test_clear() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("nothingValue"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("nothingValue"), 0); ec.addExpected(1234); ec.reset(); MOCKPP_ASSERT_TRUE(false == ec.hasExpectations()); @@ -204,7 +204,7 @@ void ExpectationList_test::fail_clearActual() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("testList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("testList"), 0); ec.addExpected(3); ec.addActual(3); ec.clearActual(); @@ -214,7 +214,7 @@ ec.verify(); } #ifndef MOCKPP_NO_EXCEPTIONS - catch(mockpp::AssertionFailedError &) + catch(MOCKPP_NS::AssertionFailedError &) { thrown = true; } @@ -225,14 +225,14 @@ void ExpectationList_test::test_ifNoExpected() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("nothingList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("nothingList"), 0); ec.addActual(3); // fails because no expectation value } void ExpectationList_test::fail_ifNoActual() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("nothingList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("nothingList"), 0); ec.addExpected(3); bool thrown = false; MOCKPP_TRY @@ -240,7 +240,7 @@ ec.verify(); // fails because no value } #ifndef MOCKPP_NO_EXCEPTIONS - catch(mockpp::AssertionFailedError &) + catch(MOCKPP_NS::AssertionFailedError &) { thrown = true; } @@ -249,7 +249,7 @@ } -static void doNothing(mockpp::ExpectationList<int> &ec) +static void doNothing(MOCKPP_NS::ExpectationList<int> &ec) { ec.addExpected(3); ec.setExpectNothing(); @@ -258,7 +258,7 @@ void ExpectationList_test::test_expectNothing() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("nothingList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("nothingList"), 0); doNothing(ec); ec.verify(); // no fail } @@ -266,7 +266,7 @@ void ExpectationList_test::test_expectNothing_revoked() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("nothingList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("nothingList"), 0); ec.setExpectNothing(); ec.addExpected(3); ec.addActual(3); @@ -276,7 +276,7 @@ void ExpectationList_test::fail_expectNothing() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("nothingList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("nothingList"), 0); doNothing(ec); bool thrown = false; MOCKPP_TRY @@ -284,7 +284,7 @@ ec.addActual(3); // fails even if equal } #ifndef MOCKPP_NO_EXCEPTIONS - catch(mockpp::AssertionFailedError &) + catch(MOCKPP_NS::AssertionFailedError &) { thrown = true; } @@ -293,7 +293,7 @@ } -static void doActualImmediate(mockpp::ExpectationList<int> &ec) +static void doActualImmediate(MOCKPP_NS::ExpectationList<int> &ec) { ec.addExpected(1234); ec.addExpected(5678); @@ -309,7 +309,7 @@ void ExpectationList_test::test_expectActualImmediate() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("actualList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("actualList"), 0); doActualImmediate(ec); ec.verify(); // no fail } @@ -317,7 +317,7 @@ void ExpectationList_test::test_many() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("actualList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("actualList"), 0); int prep[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; ec.addExpected(prep+0, prep+10); @@ -327,7 +327,7 @@ void ExpectationList_test::fail_many() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("actualList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("actualList"), 0); int prep[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; @@ -338,7 +338,7 @@ ec.addActual(prep+2, prep+10); } #ifndef MOCKPP_NO_EXCEPTIONS - catch(mockpp::AssertionFailedError &) + catch(MOCKPP_NS::AssertionFailedError &) { thrown = true; } @@ -349,7 +349,7 @@ void ExpectationList_test::fail_expectActualImmediate() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("actualList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("actualList"), 0); doActualImmediate(ec); bool thrown = false; MOCKPP_TRY @@ -357,7 +357,7 @@ ec.addActual(4321); // fails } #ifndef MOCKPP_NO_EXCEPTIONS - catch(mockpp::AssertionFailedError &) + catch(MOCKPP_NS::AssertionFailedError &) { thrown = true; } @@ -366,7 +366,7 @@ } -static void doActualVerify(mockpp::ExpectationList<int> &ec) +static void doActualVerify(MOCKPP_NS::ExpectationList<int> &ec) { ec.addExpected(1234); ec.setFailOnVerify(); @@ -376,14 +376,14 @@ void ExpectationList_test::test_expectActualVerify() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("verifyList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("verifyList"), 0); doActualVerify(ec); // no fail } void ExpectationList_test::fail_expectActualVerify() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("verifyList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("verifyList"), 0); doActualVerify(ec); // no fail bool thrown = false; MOCKPP_TRY @@ -391,7 +391,7 @@ ec.verify(); // fails } #ifndef MOCKPP_NO_EXCEPTIONS - catch(mockpp::AssertionFailedError &) + catch(MOCKPP_NS::AssertionFailedError &) { thrown = true; } @@ -402,7 +402,7 @@ void ExpectationList_test::test_balance() { - mockpp::ExpectationList<int> ec (MOCKPP_PCHAR("verifyList"), 0); + MOCKPP_NS::ExpectationList<int> ec (MOCKPP_PCHAR("verifyList"), 0); ec.addExpected(1); ec.addExpected(2); Index: IsLessThan_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/IsLessThan_test.cpp,v retrieving r... [truncated message content] |