[Mockpp-commits] mockpp/mockpp MockTimeServer.cpp,NONE,1.1 MockTimeServer.h,NONE,1.1 Makefile.am,1.7
Brought to you by:
ewald-arnold
From: Ewald A. <ewa...@us...> - 2005-04-30 15:06:15
|
Update of /cvsroot/mockpp/mockpp/mockpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18839/mockpp Modified Files: Makefile.am ThrowableList.h mockpp.h Added Files: MockTimeServer.cpp MockTimeServer.h Log Message: time server classes Index: mockpp.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/mockpp.h,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- mockpp.h 10 Apr 2005 13:46:28 -0000 1.53 +++ mockpp.h 30 Apr 2005 15:06:05 -0000 1.54 @@ -75,6 +75,8 @@ - \ref grp_constraint - \ref grp_constraint_abbrev - \ref grp_helper + - More about production code + - \ref grp_production */ Index: Makefile.am =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/Makefile.am,v retrieving revision 1.79 retrieving revision 1.80 diff -u -d -r1.79 -r1.80 --- Makefile.am 24 Apr 2005 11:35:16 -0000 1.79 +++ Makefile.am 30 Apr 2005 15:06:04 -0000 1.80 @@ -1,6 +1,7 @@ INCLUDES = -I/usr/local/include $(all_includes) -I$(top_srcdir) -SUBDIRS = chaining compat util builder constraint matcher stub . docs tests po examples +SUBDIRS = chaining compat util builder constraint matcher stub production . docs tests po \ + examples lib_LTLIBRARIES = libmockpp.la @@ -9,15 +10,16 @@ libmockpp_la_LDFLAGS = -no-undefined \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -libmockpp_la_LIBADD = $(top_builddir)/mockpp/util/libutil.la \ - $(top_builddir)/mockpp/stub/libstub.la $(top_builddir)/mockpp/matcher/libmatcher.la \ - $(top_builddir)/mockpp/constraint/libconstraint.la $(top_builddir)/mockpp/compat/libcompat.la \ - $(top_builddir)/mockpp/chaining/libchaining.la $(top_builddir)/mockpp/builder/libbuilder.la +libmockpp_la_LIBADD = $(top_builddir)/mockpp/production/libmockpp_production.la \ + $(top_builddir)/mockpp/util/libutil.la $(top_builddir)/mockpp/stub/libstub.la \ + $(top_builddir)/mockpp/matcher/libmatcher.la $(top_builddir)/mockpp/constraint/libconstraint.la \ + $(top_builddir)/mockpp/compat/libcompat.la $(top_builddir)/mockpp/chaining/libchaining.la \ + $(top_builddir)/mockpp/builder/libbuilder.la libmockpp_la_SOURCES = ExpectationCounter.cpp mockpp.cpp Throwable.cpp \ - ThrowableList.cpp MockObject.cpp VisitableMockObject.cpp VerifiableList.cpp \ - Verifiable.cpp VerifyingTestCase.cpp SelfDescribing.cpp ChainableMockObject.cpp \ - VerifyingTestCaller.cpp TrackingCounter.cpp MixedMockObject.cpp + ThrowableList.cpp MockObject.cpp VisitableMockObject.cpp VerifiableList.cpp \ + Verifiable.cpp VerifyingTestCase.cpp SelfDescribing.cpp ChainableMockObject.cpp \ + VerifyingTestCaller.cpp TrackingCounter.cpp MixedMockObject.cpp MockTimeServer.cpp pkginclude_HEADERS = mockpp_config.h ReturnObjectList.h Expectation.h \ AbstractExpectation.h ExpectationValue.h ExpectationSegment.h ExpectationList.h \ Index: ThrowableList.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/ThrowableList.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ThrowableList.h 21 Apr 2005 20:35:41 -0000 1.18 +++ ThrowableList.h 30 Apr 2005 15:06:05 -0000 1.19 @@ -50,7 +50,7 @@ public: /** Construct a new empty list - * @param aName Label used to identify list + * @param aName Label used to identify list * @param parent parent verifiable */ ThrowableList(const String &aName, VerifiableList *parent); --- NEW FILE: MockTimeServer.h --- /** @file @brief Time dependent objects $Id: MockTimeServer.h,v 1.1 2005/04/30 15:06:05 ewald-arnold Exp $ **************************************************************************/ /************************************************************************** begin : Sat Apr 30 2005 copyright : (C) 2002-2005 by Ewald Arnold email : mockpp at ewald-arnold dot de 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. **/ #ifndef MOCKPP_TimeServerMock_H #define MOCKPP_TimeServerMock_H #include <mockpp/mockpp.h> // always first #include <mockpp/production/TimeServer.h> #include <mockpp/ReturnObjectList.h> namespace mockpp { /** Mock object to return defined time points. * Some unix times: * @li 2005-02-02T10:52:19 ==> 1107337939L (0x4200A2D3) */ class MockTimeServer : public TimeServer { public: /** Construct a mock time server * @param name object name * @param parent parent verifiable */ MockTimeServer(const String &name = MOCKPP_PCHAR("") , mockpp::VerifiableList *parent = 0); /** Returns the "current" unix time * @return unix time */ virtual std::time_t getUnixTime(); /** Adds another "current" unix time * @param time unix time */ void addUnixTime(std::time_t time); private: mockpp::ReturnObjectList<std::time_t> mocktimes; }; } // namespace mockpp #endif // MOCKPP_TimeServerMock_H --- NEW FILE: MockTimeServer.cpp --- /** @file @brief Mock time dependent objects $Id: MockTimeServer.cpp,v 1.1 2005/04/30 15:06:05 ewald-arnold Exp $ **************************************************************************/ /************************************************************************** begin : Sat Apr 30 2005 copyright : (C) 2002-2005 by Ewald Arnold email : mockpp at ewald-arnold dot de 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 <mockpp/MockTimeServer.h> namespace mockpp { MOCKPP_EXPORT MockTimeServer::MockTimeServer(const String &name, VerifiableList *parent) : mocktimes(name + MOCKPP_PCHAR("/MockTimeServer"), parent) { } std::time_t MOCKPP_EXPORT MockTimeServer::getUnixTime() { return mocktimes.nextReturnObject(); } void MOCKPP_EXPORT MockTimeServer::addUnixTime(std::time_t time) { mocktimes.addObjectToReturn(time); } } // namespace mockpp |