Update of /cvsroot/mockpp/mockpp/mockpp
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27415/mockpp
Modified Files:
Makefile.am
Added Files:
VisitableMockMethod.h
Log Message:
new files
--- NEW FILE: VisitableMockMethod.h ---
/** @file
@brief Visitable Mock Methods based on templates
$Id: VisitableMockMethod.h,v 1.1 2005/10/02 18:51:33 ewald-arnold Exp $
***************************************************************************/
/**************************************************************************
begin : Thu Oct 2 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_VisitableMockMethod_H
#define MOCKPP_VisitableMockMethod_H
#include <mockpp/mockpp.h>
#include <mockpp/VisitableMockObject.h>
namespace mockpp {
template <typename R>
class VisitableMockMethodBase : public MockObject
{
public:
typedef R ReturnType;
/** Constructs the mock object.
* @param name human readable description about the expectation
* @param parent parent Visitable mock object
*/
VisitableMockMethodBase(const String &name, VisitableMockObject *parent = 0)
: MockObject(name, parent)
{}
String getMethodName() const
{
// static CppString method_name = getVerifiableName() + MOCKPP_PCHAR(".") + m_name;
return getVerifiableName();
}
};
template <typename R, typename P1>
class VisitableMockMethod1 : public VisitableMockMethodBase<R>
{
public:
/** Constructs the mock object.
* @param name human readable description about the expectation
* @param parent parent Visitable mock object
*/
VisitableMockMethod1(const String &name, VisitableMockObject *parent = 0)
: VisitableMockMethodBase<R>(name, parent)
{}
R forward(P1 param1) const
{
return R();
}
class ChainerFor
{
public:
};
private:
VisitableMockObject *Visitable_parent;
};
} // namespace mockpp
#endif // MOCKPP_VisitableMockMethod_H
Index: Makefile.am
===================================================================
RCS file: /cvsroot/mockpp/mockpp/mockpp/Makefile.am,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- Makefile.am 19 Sep 2005 18:39:58 -0000 1.86
+++ Makefile.am 2 Oct 2005 18:51:33 -0000 1.87
@@ -29,7 +29,8 @@
VisitableMockObject_macro.h VisitableMockObject_template.h ExpectationConglomeration.h \
ExpectationCounter.h mockpp.h Throwable.h ThrowableList.h MockObject.h VisitableMockObject.h \
VerifiableList.h Verifiable.h VerifyingTestCase.h SelfDescribing.h ChainableMockObject.h \
- VerifyingTestCaller.h TrackingCounter.h MixedMockObject.h mockpp_dbc.h MockTimeServer.h
+ VerifyingTestCaller.h TrackingCounter.h MixedMockObject.h mockpp_dbc.h MockTimeServer.h \
+ VisitableMockMethod.h
EXTRA_DIST = \
mockpp_config-bcb5.h \
|