[Mockpp-commits] mockpp/mockpp/matcher InvokeAtLeastOnceMatcher.cpp,NONE,1.1 InvokeAtLeastOnceMatche
Brought to you by:
ewald-arnold
|
From: Ewald A. <ewa...@us...> - 2005-03-03 15:51:27
|
Update of /cvsroot/mockpp/mockpp/mockpp/matcher In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19683/mockpp/matcher Modified Files: InvokeAtLeastOnceMatcher.h Makefile.am Added Files: InvokeAtLeastOnceMatcher.cpp Log Message: separated header from source --- NEW FILE: InvokeAtLeastOnceMatcher.cpp --- /** @file @brief Matches an invocation count of at least 1 $Id: InvokeAtLeastOnceMatcher.cpp,v 1.1 2005/03/03 15:51:00 ewald-arnold Exp $ ***************************************************************************/ /************************************************************************** begin : Thu Aug 26 2004 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. * * Original Java Sources: Copyright (c) 2000-2004, jMock.org * **/ #include <mockpp/mockpp.h> // always first #include <mockpp/matcher/InvokeAtLeastOnceMatcher.h> namespace mockpp { void MOCKPP_EXPORT InvokeAtLeastOnceMatcher::verify() { verifyHasBeenInvoked(); } bool MOCKPP_EXPORT InvokeAtLeastOnceMatcher::hasDescription() { return true; } bool MOCKPP_EXPORT InvokeAtLeastOnceMatcher::matches( ) { return true; } String MOCKPP_EXPORT InvokeAtLeastOnceMatcher::describeTo( String &buffer ) const { buffer += MOCKPP_PCHAR("expected at least once"); if (hasBeenInvoked()) { buffer += MOCKPP_PCHAR(" and has been invoked"); } return buffer; } } // namespace mockpp Index: Makefile.am =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/matcher/Makefile.am,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile.am 24 Oct 2004 16:43:22 -0000 1.10 --- Makefile.am 3 Mar 2005 15:51:00 -0000 1.11 *************** *** 13,17 **** libmatcher_la_SOURCES = InvokeAtLeastMatcher.cpp InvokeAtMostMatcher.cpp \ InvokeCountMatcher.cpp InvokedRecorder.cpp InvokeOnceMatcher.cpp TestFailureMatcher.cpp \ ! TypelessMatcher.cpp CLEANFILES = *.~* *.~~* *~ *.old --- 13,17 ---- libmatcher_la_SOURCES = InvokeAtLeastMatcher.cpp InvokeAtMostMatcher.cpp \ InvokeCountMatcher.cpp InvokedRecorder.cpp InvokeOnceMatcher.cpp TestFailureMatcher.cpp \ ! TypelessMatcher.cpp InvokeAtLeastOnceMatcher.cpp CLEANFILES = *.~* *.~~* *~ *.old Index: InvokeAtLeastOnceMatcher.h =================================================================== RCS file: /cvsroot/mockpp/mockpp/mockpp/matcher/InvokeAtLeastOnceMatcher.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** InvokeAtLeastOnceMatcher.h 27 Feb 2005 11:48:16 -0000 1.21 --- InvokeAtLeastOnceMatcher.h 3 Mar 2005 15:51:00 -0000 1.22 *************** *** 32,37 **** **/ ! #ifndef MOCKPP_INVOKEATLEATONCEMATCHER_H ! #define MOCKPP_INVOKEATLEATONCEMATCHER_H #include <mockpp/mockpp.h> // always first --- 32,37 ---- **/ ! #ifndef MOCKPP_INVOKEATLEASTONCEMATCHER_H ! #define MOCKPP_INVOKEATLEASTONCEMATCHER_H #include <mockpp/mockpp.h> // always first *************** *** 53,76 **** * If it fails, an AssertionFailedError is thrown */ ! virtual void verify() ! { ! verifyHasBeenInvoked(); ! } /** Does the object provide meaningful description via describeTo() ?. * @return true: description is available */ ! virtual bool hasDescription() ! { ! return true; ! } /** Checks if an invocation matches the expectaton * @return true: the invocation matches */ ! virtual bool matches( ) ! { ! return true; ! } /** Appends the description of this object to the buffer. --- 53,67 ---- * If it fails, an AssertionFailedError is thrown */ ! virtual void verify(); /** Does the object provide meaningful description via describeTo() ?. * @return true: description is available */ ! virtual bool hasDescription(); /** Checks if an invocation matches the expectaton * @return true: the invocation matches */ ! virtual bool matches( ); /** Appends the description of this object to the buffer. *************** *** 78,91 **** * @return The current content of the buffer data */ ! virtual String describeTo( String &buffer ) const ! { ! buffer += MOCKPP_PCHAR("expected at least once"); ! if (hasBeenInvoked()) ! { ! buffer += MOCKPP_PCHAR(" and has been invoked"); ! } ! ! return buffer; ! } }; --- 69,73 ---- * @return The current content of the buffer data */ ! virtual String describeTo( String &buffer ) const; }; *************** *** 94,97 **** ! #endif // MOCKPP_INVOKEATLEATONCEMATCHER_H --- 76,79 ---- ! #endif // MOCKPP_INVOKEATLEASTONCEMATCHER_H |