Update of /cvsroot/mockpp/mockpp/mockpp
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26541/mockpp
Modified Files:
VisitableMockMethod.h
Log Message:
fix "inline"
Index: VisitableMockMethod.h
===================================================================
RCS file: /cvsroot/mockpp/mockpp/mockpp/VisitableMockMethod.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- VisitableMockMethod.h 6 Nov 2005 14:12:07 -0000 1.15
+++ VisitableMockMethod.h 8 Nov 2005 18:41:43 -0000 1.16
@@ -40,6 +40,8 @@
namespace mockpp {
+/** Base of all mock methods.
+ */
class VisitableMockMethodBase : public MockObject
{
public:
@@ -80,22 +82,22 @@
throwableInsteadReturn.erase(throwableInsteadReturn.begin());
}
}
-
+
if (do_throw && throwables.hasMoreObjects() != 0)
{
Throwable *thr = throwables.nextThrowableObject();
if (thr != 0)
thr->throw_me();
}
-
+
if (defaultThrowable.get() != 0)
defaultThrowable.get()->throw_me();
}
-
+
//-------------------------------------------------------------
public:
-
+
/** A controller to set up the mock method.
*/
template <class VMM>
@@ -178,8 +180,8 @@
}
/**
- * Verify the conditions which are not in the verify() chain of the
- * visitable mock object. Located here instead of the method for traditional
+ * Verify the conditions which are not in the verify() chain of the
+ * visitable mock object. Located here instead of the method for traditional
* reasons.
* If it fails, an AssertionFailedError is thrown
*/
@@ -203,7 +205,7 @@
template <class VMM>
friend class ControllerFor;
- private:
+ protected:
VisitableMockObject *visitable;
mutable ThrowableItem defaultThrowable;
@@ -216,6 +218,8 @@
//////////////////////////////////////////////////////////////////////////////////////////////
+/** Base of all mock methods returning some value.
+ */
template <typename R>
class VisitableMockReturningMethodBase : public VisitableMockMethodBase
{
@@ -274,20 +278,6 @@
}
}
- /** Determines the current return value.
- * The values from the default value or the list are returned one after
- * the other.
- */
- R determineReturnValue()
- {
- if (this->method->returnValues.hasMoreObjects())
- return this->method->returnValues.nextReturnObject();
-
- MOCKPP_ASSERT_TRUE(this->method->haveDefaultReturnValue == true);
- this->method->defaultReturnValueUsed = true;
- return this->method->defaultReturnValue;
- }
-
/** Sets all internal objects to the state after construction.
*/
virtual void reset()
@@ -310,10 +300,26 @@
MOCKPP_ASSERT_TRUE_MESSAGE(fmt, this->method->defaultReturnValueUsed);
}
}
-
};
-#ifdef __BORLANDC__
+ protected:
+
+ /** Determines the current return value.
+ * The values from the default value or the list are returned one after
+ * the other.
+ */
+ R determineReturnValue()
+ {
+ throwableInsteadReturn.erase(throwableInsteadReturn.begin());
+ if (returnValues.hasMoreObjects())
+ return returnValues.nextReturnObject();
+
+ MOCKPP_ASSERT_TRUE(haveDefaultReturnValue == true);
+ defaultReturnValueUsed = true;
+ return defaultReturnValue;
+ }
+
+#ifdef __BORLANDC__
friend class ControllerFor; // BCB5
#else
friend class VisitableMockReturningMethodBase::ControllerFor;
@@ -328,6 +334,8 @@
};
+/** Base of all mock methods returning void.
+ */
template <>
class VisitableMockReturningMethodBase<void> : public VisitableMockMethodBase
{
@@ -358,7 +366,7 @@
}
};
-#ifdef __BORLANDC__ // BCB5
+#ifdef __BORLANDC__ // BCB5
friend class ControllerFor;
#else
friend class VisitableMockReturningMethodBase<void>::ControllerFor;
|