Thread: [Mockpp-commits] mockpp/mockpp/tests AbstractDynamicChainingMock_test.cpp,1.38,1.39 And_test.cpp,1.1
Brought to you by:
ewald-arnold
Update of /cvsroot/mockpp/mockpp/mockpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27489/mockpp/tests Modified Files: AbstractDynamicChainingMock_test.cpp And_test.cpp ChainableMockMethod_1_test.cpp ChainableMockMethod_2_test.cpp ChainableMockMethod_test.cpp ChainableMockObjectPolymorphism_test.cpp CoreMock_test.cpp Makefile.am MockObject_test.cpp NoException_test.cpp TrackingCounter_test.cpp Verifiable_test.cpp VisitableMockMethod_1_test.cpp VisitableMockMethod_2_test.cpp VisitableMockMethod_test.cpp VisitableMockObject_test.cpp mock_test.cpp mockpp_pti_test.cpp Log Message: Boost.Test basically running Index: VisitableMockMethod_2_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockMethod_2_test.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- VisitableMockMethod_2_test.cpp 30 Dec 2005 15:31:59 -0000 1.16 +++ VisitableMockMethod_2_test.cpp 1 Jan 2006 10:27:23 -0000 1.17 @@ -94,7 +94,7 @@ , visitablev_mocker(MOCKPP_PCHAR("visitablev2"), this) {} - MOCKPP_TEST_DECL void visitable(const mockpp::ConstraintHolder<unsigned> &p1, + void visitable(const mockpp::ConstraintHolder<unsigned> &p1, const mockpp::ConstraintHolder<unsigned> &p2) { visitable_mocker.forward(p1, p2); @@ -105,13 +105,13 @@ return visitable_mocker.forward(i, j); } - MOCKPP_TEST_DECL void visitablev(const mockpp::ConstraintHolder<unsigned> &p1, + void visitablev(const mockpp::ConstraintHolder<unsigned> &p1, const mockpp::ConstraintHolder<unsigned> &p2) { visitablev_mocker.forward(p1, p2); } - MOCKPP_TEST_DECL void visitablev(unsigned i, unsigned j) + void visitablev(unsigned i, unsigned j) { visitablev_mocker.forward(i, j); } Index: And_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/And_test.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- And_test.cpp 30 Dec 2005 15:31:58 -0000 1.17 +++ And_test.cpp 1 Jan 2006 10:27:22 -0000 1.18 @@ -71,6 +71,9 @@ #elif defined(MOCKPP_USE_BOOSTTEST) +MOCKPP_BOOST_TEST( And_test::test_invoke); +MOCKPP_BOOST_TEST( And_test::test_describe); + #elif defined(MOCKPP_USE_CPPUNIT) CPPUNIT_TEST_SUITE_REGISTRATION (And_test); Index: mock_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/mock_test.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- mock_test.cpp 30 Dec 2005 15:31:59 -0000 1.33 +++ mock_test.cpp 1 Jan 2006 10:27:23 -0000 1.34 @@ -60,6 +60,11 @@ #elif defined(MOCKPP_USE_BOOSTTEST) +#define BOOST_AUTO_TEST_MAIN +#include <boost/test/auto_unit_test.hpp> +#include <boost/test/unit_test.hpp> +using namespace boost::unit_test_framework; + #elif defined(MOCKPP_USE_CPPUNIT) # include <cppunit/extensions/TestFactoryRegistry.h> @@ -169,6 +174,29 @@ #endif +#if defined(MOCKPP_USE_BOOSTTEST) + +test_suite* +init_unit_test_suite( int argc, char* argv[] ) +{ + std::cout << "starting tests..\n"; + std::cout << " - using Boost.Test framework\n"; +#ifdef MOCKPP_PTI_WEAKNESS + std::cout << " - support pti-weakness enabled\n"; +#else + std::cout << " - support pti-weakness disabled\n"; +#endif + + std::cout << " - size of <char> is " << sizeof(MOCKPP_CHAR('x')) << std::endl; + std::cout << "\n"; + + test_suite* test= BOOST_TEST_SUITE( "const_string test" ); + + return test; +} + +#else + int main(int argc, char **argv) { int ret = 1; @@ -193,8 +221,6 @@ ret = run_cxxtest(argc, argv); -#elif defined(MOCKPP_USE_BOOSTTEST) - #elif defined(MOCKPP_USE_CPPUNIT) std::cout << "Options\n"; @@ -210,3 +236,7 @@ std::cout << "Result: " << ret << std::endl << std::endl; return ret; } + + +#endif // frameworks + Index: NoException_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/NoException_test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- NoException_test.cpp 30 Dec 2005 15:31:59 -0000 1.11 +++ NoException_test.cpp 1 Jan 2006 10:27:23 -0000 1.12 @@ -59,6 +59,9 @@ { public: + virtual ~NoException_test() + {} + #if defined (MOCKPP_USE_CXXTEST) #elif defined(MOCKPP_USE_BOOSTTEST) Index: ChainableMockMethod_2_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockMethod_2_test.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ChainableMockMethod_2_test.cpp 30 Dec 2005 15:31:58 -0000 1.15 +++ ChainableMockMethod_2_test.cpp 1 Jan 2006 10:27:22 -0000 1.16 @@ -109,7 +109,7 @@ return chainable_mocker.forward(i, l); } - MOCKPP_TEST_DECL void chainablev(unsigned i, long l) + void chainablev(unsigned i, long l) { chainablev_mocker.forward(i, l); } Index: Verifiable_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/Verifiable_test.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Verifiable_test.cpp 30 Dec 2005 15:31:59 -0000 1.27 +++ Verifiable_test.cpp 1 Jan 2006 10:27:23 -0000 1.28 @@ -142,7 +142,7 @@ } // make public for test purposes - MOCKPP_TEST_DECL void clearVer() + void clearVer() { #ifdef _MSC_VER VerifiableList::clearVerifiables(); @@ -170,7 +170,7 @@ #endif } - MOCKPP_TEST_DECL void addVerifiable(mockpp::Verifiable *vf) + void addVerifiable(mockpp::Verifiable *vf) { #ifdef _MSC_VER VerifiableList::addVerifiable(vf); @@ -179,7 +179,7 @@ #endif } - MOCKPP_TEST_DECL void removeVerifiable(mockpp::Verifiable *vf) + void removeVerifiable(mockpp::Verifiable *vf) { #ifdef _MSC_VER VerifiableList::removeVerifiable(vf); Index: AbstractDynamicChainingMock_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/AbstractDynamicChainingMock_test.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- AbstractDynamicChainingMock_test.cpp 30 Dec 2005 15:31:58 -0000 1.38 +++ AbstractDynamicChainingMock_test.cpp 1 Jan 2006 10:27:22 -0000 1.39 @@ -126,7 +126,7 @@ return mockInvocation(invocation); } - MOCKPP_TEST_DECL void void_invoke(const I &invocation) + void void_invoke(const I &invocation) { mockInvocation(invocation); } @@ -369,7 +369,7 @@ bool invoked; - MOCKPP_TEST_DECL void invoke( const I &/*invocation*/ ) + void invoke( const I &/*invocation*/ ) { invoked = true; } Index: TrackingCounter_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/TrackingCounter_test.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- TrackingCounter_test.cpp 30 Dec 2005 15:31:59 -0000 1.15 +++ TrackingCounter_test.cpp 1 Jan 2006 10:27:23 -0000 1.16 @@ -158,7 +158,7 @@ virtual void reset() {} - MOCKPP_TEST_DECL void clearActual() + void clearActual() {} unsigned getActual() const Index: mockpp_pti_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/mockpp_pti_test.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- mockpp_pti_test.cpp 30 Dec 2005 15:31:59 -0000 1.13 +++ mockpp_pti_test.cpp 1 Jan 2006 10:27:23 -0000 1.14 @@ -205,7 +205,7 @@ { public: - MOCKPP_TEST_DECL void myDispatch( const Setter1Invocation &invocation ) + void myDispatch( const Setter1Invocation &invocation ) { dispatch(invocation); } @@ -238,7 +238,7 @@ { public: - MOCKPP_TEST_DECL void myDispatch( const Setter1Invocation &invocation ) + void myDispatch( const Setter1Invocation &invocation ) { dispatch(invocation); } @@ -334,7 +334,7 @@ : mockpp::AbstractDynamicChainingMock<void, Setter1Invocation>(invocationDispatcher, name, parent) {} - MOCKPP_TEST_DECL void invoke(const Setter1Invocation &invocation) + void invoke(const Setter1Invocation &invocation) { mockInvocation(invocation); } Index: ChainableMockObjectPolymorphism_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockObjectPolymorphism_test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChainableMockObjectPolymorphism_test.cpp 30 Dec 2005 15:31:58 -0000 1.11 +++ ChainableMockObjectPolymorphism_test.cpp 1 Jan 2006 10:27:22 -0000 1.12 @@ -127,13 +127,13 @@ , parameter3( in_parameter1 ) {} - MOCKPP_TEST_DECL void accept1( Visitor &visitor ) + void accept1( Visitor &visitor ) { // std::cout << "accept1\n"; visitor.visit1( parameter1 ); } - MOCKPP_TEST_DECL void accept3( Visitor &visitor ) + void accept3( Visitor &visitor ) { // std::cout << "accept3\n"; visitor.visit3( parameter1, parameter2, parameter3 ); Index: Makefile.am =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/Makefile.am,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- Makefile.am 28 Dec 2005 09:23:31 -0000 1.98 +++ Makefile.am 1 Jan 2006 10:27:22 -0000 1.99 @@ -5,8 +5,6 @@ ########################################################################### -AM_LDFLAGS = $(all_libraries) - if WORKING_WIN32 win32_app = mock_test_win32 endif @@ -32,6 +30,8 @@ ########################################################################### +AM_LDFLAGS = $(all_libraries) + AM_CXXFLAGS = -I$(QTDIR)/include -I/usr/X11R6/include ########################################################################### @@ -40,9 +40,6 @@ cxxtest_lib=$(top_builddir)/3party/cxxtest/cxxtest/libmockpp_cxxtest.la endif -mock_test_LDADD = $(top_builddir)/mockpp/libmockpp.la \ - $(cxxtest_lib) $(LIBDL) -lstdc++ $(EA_EXTRA_LIB) - if WORKING_QT mock_test_qt_LDADD = $(top_builddir)/mockpp/libmockpp.la \ $(cxxtest_lib) $(LIBDL) -lstdc++ $(EA_EXTRA_LIB) -lqt-mt @@ -58,8 +55,11 @@ $(cxxtest_lib) $(LIBDL) -lstdc++ $(EA_EXTRA_LIB) -lwindows endif +mock_test_LDADD = $(top_builddir)/mockpp/libmockpp.la \ + $(cxxtest_lib) $(LIBDL) -lstdc++ $(EA_EXTRA_LIB) $(LIBBOOST) + jmock_test_LDADD = $(top_builddir)/mockpp/libmockpp.la \ - $(cxxtest_lib) $(LIBDL) -lstdc++ $(EA_EXTRA_LIB) + $(cxxtest_lib) $(LIBDL) -lstdc++ $(EA_EXTRA_LIB) $(LIBBOOST) readability_test_LDADD = $(top_builddir)/mockpp/libmockpp.la \ $(cxxtest_lib) $(LIBDL) -lstdc++ $(EA_EXTRA_LIB) Index: VisitableMockObject_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockObject_test.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- VisitableMockObject_test.cpp 30 Dec 2005 15:31:59 -0000 1.31 +++ VisitableMockObject_test.cpp 1 Jan 2006 10:27:23 -0000 1.32 @@ -123,6 +123,26 @@ #elif defined(MOCKPP_USE_BOOSTTEST) +MOCKPP_BOOST_TEST(VisitableMockObject_test::test_controller); +MOCKPP_BOOST_TEST(VisitableMockObject_test::test_thrower); +MOCKPP_BOOST_TEST(VisitableMockObject_test::test_return); +MOCKPP_BOOST_TEST(VisitableMockObject_test::test_clear); +MOCKPP_BOOST_TEST(VisitableMockObject_test::test_parameter_ex); +MOCKPP_BOOST_TEST(VisitableMockObject_test::test_inline_pre_1_2); +MOCKPP_BOOST_TEST(VisitableMockObject_test::test_inline_post_1_2); +MOCKPP_BOOST_TEST(VisitableMockObject_test::test_method_unused); + +MOCKPP_BOOST_TEST(VisitableMockObject_test::fail_add_throw_after_active); +MOCKPP_BOOST_TEST(VisitableMockObject_test::fail_add_throw_val_after_active); +MOCKPP_BOOST_TEST(VisitableMockObject_test::fail_set_throw_after_active); +MOCKPP_BOOST_TEST(VisitableMockObject_test::fail_add_method_after_active); +MOCKPP_BOOST_TEST(VisitableMockObject_test::fail_add_return_after_active); +MOCKPP_BOOST_TEST(VisitableMockObject_test::fail_set_return_after_active); +MOCKPP_BOOST_TEST(VisitableMockObject_test::fail_return); +MOCKPP_BOOST_TEST(VisitableMockObject_test::fail_unused_throwable); +MOCKPP_BOOST_TEST(VisitableMockObject_test::fail_unused_value); +MOCKPP_BOOST_TEST(VisitableMockObject_test::test_stub_return_const_ref); + #elif defined(MOCKPP_USE_CPPUNIT) CPPUNIT_TEST_SUITE_REGISTRATION (VisitableMockObject_test); Index: ChainableMockMethod_1_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockMethod_1_test.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- ChainableMockMethod_1_test.cpp 30 Dec 2005 15:31:58 -0000 1.16 +++ ChainableMockMethod_1_test.cpp 1 Jan 2006 10:27:22 -0000 1.17 @@ -110,7 +110,7 @@ return chainable_mocker.forward(i); } - MOCKPP_TEST_DECL void chainablev(unsigned i) + void chainablev(unsigned i) { chainablev_mocker.forward(i); } Index: MockObject_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/MockObject_test.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- MockObject_test.cpp 30 Dec 2005 15:31:59 -0000 1.23 +++ MockObject_test.cpp 1 Jan 2006 10:27:23 -0000 1.24 @@ -111,7 +111,7 @@ } - MOCKPP_TEST_DECL void execTest() + void execTest() { lev1a.setFailOnVerify(); lev1a.setExpected(12345); @@ -119,7 +119,7 @@ } - MOCKPP_TEST_DECL void execFail() + void execFail() { lev1a.setFailOnVerify(); lev1a.setExpected(12345); Index: VisitableMockMethod_1_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockMethod_1_test.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- VisitableMockMethod_1_test.cpp 30 Dec 2005 15:31:59 -0000 1.11 +++ VisitableMockMethod_1_test.cpp 1 Jan 2006 10:27:23 -0000 1.12 @@ -94,7 +94,7 @@ , visitablev_mocker(MOCKPP_PCHAR("visitablev2"), this) {} - MOCKPP_TEST_DECL void visitable(const mockpp::ConstraintHolder<unsigned> &p1) + void visitable(const mockpp::ConstraintHolder<unsigned> &p1) { visitable_mocker.forward(p1); } @@ -104,12 +104,12 @@ return visitable_mocker.forward(i); } - MOCKPP_TEST_DECL void visitablev(const mockpp::ConstraintHolder<unsigned> &p1) + void visitablev(const mockpp::ConstraintHolder<unsigned> &p1) { visitablev_mocker.forward(p1); } - MOCKPP_TEST_DECL void visitablev(unsigned i) + void visitablev(unsigned i) { visitablev_mocker.forward(i); } Index: VisitableMockMethod_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/VisitableMockMethod_test.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- VisitableMockMethod_test.cpp 30 Dec 2005 15:31:59 -0000 1.24 +++ VisitableMockMethod_test.cpp 1 Jan 2006 10:27:23 -0000 1.25 @@ -124,7 +124,7 @@ return visitable_mocker.forward(); } - MOCKPP_TEST_DECL void visitablev() + void visitablev() { visitablev_mocker.forward(); } @@ -181,7 +181,7 @@ {} #if defined(__BORLANDC__) // ==> BCB5.5.1 ?? F1004 Internal compiler error at 0x12548c1 with base 0x1200000 - MOCKPP_TEST_DECL void throwAvailableException() const + void throwAvailableException() const { mockpp::VisitableMockMethodBase::throwAvailableException(); } @@ -267,7 +267,7 @@ {} #if defined(__BORLANDC__) // ==> BCB5.5.1 ?? F1004 Internal compiler error at 0x12548c1 with base 0x1200000 - MOCKPP_TEST_DECL void throwAvailableException() const + void throwAvailableException() const { mockpp::VisitableMockReturningMethodBase<T>::throwAvailableException(); } Index: ChainableMockMethod_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/ChainableMockMethod_test.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ChainableMockMethod_test.cpp 30 Dec 2005 15:31:58 -0000 1.18 +++ ChainableMockMethod_test.cpp 1 Jan 2006 10:27:22 -0000 1.19 @@ -117,7 +117,7 @@ return chainable_mocker.forward(); } - MOCKPP_TEST_DECL void chainablev() + void chainablev() { chainablev_mocker.forward(); } Index: CoreMock_test.cpp =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/tests/CoreMock_test.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- CoreMock_test.cpp 30 Dec 2005 15:31:59 -0000 1.28 +++ CoreMock_test.cpp 1 Jan 2006 10:27:22 -0000 1.29 @@ -208,7 +208,7 @@ bool invoked; - MOCKPP_TEST_DECL void invoke( const I &/*invocation*/ ) + void invoke( const I &/*invocation*/ ) { invoked = true; } |