[Mockpp-commits] mockpp/mockpp/tests readability_test.cpp,NONE,1.1 Makefile.am,1.72,1.73
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2005-04-09 15:31:53
|
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25421/mockpp/tests Modified Files: Makefile.am Added Files: readability_test.cpp Log Message: new test file --- NEW FILE: readability_test.cpp --- /*************************************************************************** readability_test.cpp - visually check readability of output ------------------- begin : Sat Apr 09 2005 copyright : (C) 2002-2005 by Ewald Arnold email : mockpp at ewald-arnold dot de $Id: readability_test.cpp,v 1.1 2005/04/09 15:31:42 ewald-arnold Exp $ ***************************************************************************/ /************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2 of the License, * or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * ***************************************************************************/ #include <mockpp/mockpp.h> // always first #include <iostream> #include <mockpp/ExpectationValue.h> #include <mockpp/MixedMockObject.h> #include <mockpp/util/AssertMo.h> #define MOCKPP_IMPORT_ABBREVIATED #include <mockpp/chaining/ChainingMockObjectSupport.h> #include <mockpp/chaining/mockpp_pti.h> #include "classes_ABCDE.h" class MyMixedMockObject : public mockpp::MixedMockObject { public: MyMixedMockObject() : mockpp::MixedMockObject(MOCKPP_PCHAR("MyMixedMockObject") , 0) , MOCKPP_CONSTRUCT_MEMBERS_FOR_CHAINABLE4(chain) , MOCKPP_CONSTRUCT_MEMBERS_FOR_VISITABLE4(visit) , MOCKPP_CONSTRUCT_MEMBERS_FOR_VOID_CHAINABLE4(void_chain) , MOCKPP_CONSTRUCT_MEMBERS_FOR_VOID_VISITABLE4(void_visit) , chainer(this) , void_chainer(this) , visiter(this) , void_visiter(this) {} MOCKPP_CHAINABLE4(MyMixedMockObject, int, chain, CA, CB, std::string, char); MOCKPP_VISITABLE4(MyMixedMockObject, int, visit, CA, CB, std::string, char); MOCKPP_VOID_CHAINABLE4(MyMixedMockObject, void_chain, CA, CB, std::string, char); MOCKPP_VOID_VISITABLE4(MyMixedMockObject, void_visit, CA, CB, std::string, char); MOCKPP_CHAINER_FOR(MyMixedMockObject, chain) chainer; MOCKPP_CHAINER_FOR(MyMixedMockObject, void_chain) void_chainer; MOCKPP_CONTROLLER_FOR(MyMixedMockObject, visit) visiter; MOCKPP_CONTROLLER_FOR(MyMixedMockObject, void_visit) void_visiter; }; void chainer_1() { MyMixedMockObject mmo; mmo.chainer.expects(exactly(3)) .with(eq(CA()), eq(CB(3)), stringContains(std::string("string")), eq<char>(123, 45)) .will(returnValue(321)); mmo.chainer.expects(atLeast(3)) .with(eq(CA(5)), eq(CB()), stringContains(std::string("no-string")), eq<char>(0x23)) .will(returnValue(123)); try { mmo.chain(CA(), CB(), "hallo", 12); } catch(std::exception &ex) { std::cout << ex.what() << std::endl; } } int main(int /* argc */, char ** /* argv */) { unsigned result = 0; std::cout << "Starting readability tests..\n"; try { chainer_1(); } catch(...) { std::cout << "Caught unexpected exception\n"; result = 1; } std::cout << "Finishing readability tests\n"; return result; } Index: Makefile.am =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/Makefile.am,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- Makefile.am 3 Apr 2005 19:11:26 -0000 1.72 +++ Makefile.am 9 Apr 2005 15:31:42 -0000 1.73 @@ -2,15 +2,18 @@ CLEANFILES = *.~* *.~~* *~ -mock_test_LDADD = $(top_builddir)/mockpp/libmockpp.la $(LIBDL) -lstdc++ \ - $(EA_EXTRA_LIB) $(LIBCPPUNIT) +mock_test_LDADD = $(top_builddir)/mockpp/libmockpp.la \ + $(LIBDL) -lstdc++ $(EA_EXTRA_LIB) $(LIBCPPUNIT) -jmock_test_LDADD = $(top_builddir)/mockpp/libmockpp.la $(LIBDL) -lstdc++ \ - $(EA_EXTRA_LIB) $(LIBCPPUNIT) +jmock_test_LDADD = $(top_builddir)/mockpp/libmockpp.la \ + $(LIBDL) -lstdc++ $(EA_EXTRA_LIB) $(LIBCPPUNIT) + +readability_test_LDADD = $(top_builddir)/mockpp/libmockpp.la \ + $(LIBDL) -lstdc++ $(EA_EXTRA_LIB) $(LIBCPPUNIT) AM_LDFLAGS = $(all_libraries) -check_PROGRAMS = jmock_test mock_test +check_PROGRAMS = jmock_test mock_test readability_test SINGLE_TESTS = $(check_PROGRAMS) @@ -48,25 +51,27 @@ cat $$list.tmp | sort >$$list jmock_test_SOURCES = And_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 \ - Or_test.cpp ReturnStub_test.cpp StringContains_test.cpp StubSequence_test.cpp \ - TestFailureStub_test.cpp ThrowStub_test.cpp VoidStub_test.cpp ChainingMockObjectSupport_test.cpp \ - CustomStub_test.cpp DefaultResultStub_test.cpp mock_test.cpp Invocation_test.cpp \ - AnyArgumentsMatcher_test.cpp InvokedRecorder_test.cpp InvokeAtLeastOnceMatcher_test.cpp \ - InvokeOnceMatcher_test.cpp InvokeCountMatcher_test.cpp InvokedAfterMatcher_test.cpp \ - TestFailureMatcher_test.cpp NoArgumentsMatcher_test.cpp ArgumentsMatcher_test.cpp \ - ConstraintSet_test.cpp ArgumentsMatchBuilder_test.cpp InvocationMockerBuilder_test.cpp \ - AbstractDynamicChainingMock_test.cpp AbstractInvocationDispatcher_test.cpp ChainingMockBuilder_test.cpp \ - CoreMock_test.cpp DynamicChainingMockError_test.cpp FIFOInvocationDispatcher_test.cpp \ - InvocationMocker_test.cpp LIFOInvocationDispatcher_test.cpp InvokeAtMostMatcher_test.cpp \ - InvokedBeforeMatcher_test.cpp StubBuilder_test.cpp MatchBuilder_test.cpp \ - InvokeAtLeastMatcher_test.cpp classes_ABCDE.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 TypelessStubSequence_test.cpp \ - StringEndsWith_test.cpp StringStartsWith_test.cpp UnlimitedMatcher_test.cpp mockpp_pti_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 \ + Or_test.cpp ReturnStub_test.cpp StringContains_test.cpp StubSequence_test.cpp \ + TestFailureStub_test.cpp ThrowStub_test.cpp VoidStub_test.cpp ChainingMockObjectSupport_test.cpp \ + CustomStub_test.cpp DefaultResultStub_test.cpp mock_test.cpp Invocation_test.cpp \ + AnyArgumentsMatcher_test.cpp InvokedRecorder_test.cpp InvokeAtLeastOnceMatcher_test.cpp \ + InvokeOnceMatcher_test.cpp InvokeCountMatcher_test.cpp InvokedAfterMatcher_test.cpp \ + TestFailureMatcher_test.cpp NoArgumentsMatcher_test.cpp ArgumentsMatcher_test.cpp \ + ConstraintSet_test.cpp ArgumentsMatchBuilder_test.cpp InvocationMockerBuilder_test.cpp \ + AbstractDynamicChainingMock_test.cpp AbstractInvocationDispatcher_test.cpp ChainingMockBuilder_test.cpp \ + CoreMock_test.cpp DynamicChainingMockError_test.cpp FIFOInvocationDispatcher_test.cpp \ + InvocationMocker_test.cpp LIFOInvocationDispatcher_test.cpp InvokeAtMostMatcher_test.cpp \ + InvokedBeforeMatcher_test.cpp StubBuilder_test.cpp MatchBuilder_test.cpp \ + InvokeAtLeastMatcher_test.cpp classes_ABCDE.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 TypelessStubSequence_test.cpp \ + StringEndsWith_test.cpp StringStartsWith_test.cpp UnlimitedMatcher_test.cpp mockpp_pti_test.cpp + +readability_test_SOURCES = readability_test.cpp classes_ABCDE.cpp jmock_test_count: list=jmock_test.files; \ @@ -107,5 +112,6 @@ mock_test_LDFLAGS = -L/opt/intel_cc_80/lib -noinst_HEADERS = classes_ABCDE.h MyBuilderNamespace.h MyMatchBuilder.h +readability_test_LDFLAGS = -L/opt/intel_cc_80/lib +noinst_HEADERS = classes_ABCDE.h MyBuilderNamespace.h MyMatchBuilder.h |