28 #ifndef PT_UNIT_TESTMETHOD_H
29 #define PT_UNIT_TESTMETHOD_H
31 #include <Pt/Unit/Api.h>
32 #include <Pt/Unit/Test.h>
33 #include <Pt/SerializationInfo.h>
34 #include <Pt/TypeTraits.h>
36 #include <Pt/Method.h>
47 TestMethod(
const std::string& name)
48 : Pt::Unit::
Test(name)
56 void setArgs(
const SerializationInfo* si, std::size_t argCount)
62 const SerializationInfo* args()
const
65 std::size_t argCount()
const
69 const SerializationInfo* _args;
70 std::size_t _argCount;
83 class BasicTestMethod :
public Pt::Method<void, C, A1, A2, A3, A4, A5, A6, A7, A8>
88 typedef void (C::*MemFuncT)(A1, A2, A3, A4, A5, A6, A7, A8);
100 BasicTestMethod(
const std::string& name, C&
object, MemFuncT ptr)
101 : Pt::
Method<void, C, A1, A2, A3, A4, A5, A6, A7, A8>(object, ptr)
107 const SerializationInfo* args = this->args();
108 std::size_t argCount = this->argCount();
111 throw std::invalid_argument(
"invalid number of arguments");
148 class BasicTestMethod<C,
161 typedef void (C::*MemFuncT)(A1, A2, A3, A4, A5);
170 BasicTestMethod(
const std::string& name, C&
object, MemFuncT ptr)
171 : Pt::
Method<void, C, A1, A2, A3, A4, A5>(object, ptr)
177 const SerializationInfo* args = this->args();
178 std::size_t argCount = this->argCount();
181 throw std::invalid_argument(
"invalid number of arguments");
198 Pt::Method<void, C, A1, A2, A3, A4, A5>::call(v1, v2, v3, v4, v5);
208 class BasicTestMethod<C,
221 typedef void (C::*MemFuncT)(A1, A2, A3, A4);
229 BasicTestMethod(
const std::string& name, C&
object, MemFuncT ptr)
230 : Pt::
Method<void, C, A1, A2, A3, A4>(object, ptr)
236 const SerializationInfo* args = this->args();
237 std::size_t argCount = this->argCount();
240 throw std::invalid_argument(
"invalid number of arguments");
263 class BasicTestMethod<C,
276 typedef void (C::*MemFuncT)(A1, A2, A3);
283 BasicTestMethod(
const std::string& name, C&
object, MemFuncT ptr)
284 : Pt::
Method<void, C, A1, A2, A3>(object, ptr)
290 const SerializationInfo* args = this->args();
291 std::size_t argCount = this->argCount();
294 throw std::invalid_argument(
"invalid number of arguments");
313 class BasicTestMethod<C,
326 typedef void (C::*MemFuncT)(A1, A2);
332 BasicTestMethod(
const std::string& name, C&
object, MemFuncT ptr)
333 : Pt::
Method<void, C, A1, A2>(object, ptr)
339 const SerializationInfo* args = this->args();
340 std::size_t argCount = this->argCount();
343 throw std::invalid_argument(
"invalid number of arguments");
358 class BasicTestMethod<C,
371 typedef void (C::*MemFuncT)(A1);
376 BasicTestMethod(
const std::string& name, C&
object, MemFuncT ptr)
377 : Pt::
Method<void, C, A1>(object, ptr)
383 const SerializationInfo* args = this->args();
384 std::size_t argCount = this->argCount();
387 throw std::invalid_argument(
"invalid number of arguments");
397 class BasicTestMethod<C,
410 typedef void (C::*MemFuncT)();
413 BasicTestMethod(
const std::string& name, C&
object, MemFuncT ptr)
414 : Pt::
Method<void, C>(object, ptr)
Method(C &object, MemFuncT ptr)
Wraps the given object/member pair.
Adapter for class methods.
Definition: Method.h:19
R call(ARGUMENTS) const
Same as operator().
IMPLEMENTATION_DEFINED Value
The derived value type.
Definition: TypeTraits.h:21
Test base class
Definition: Test.h:54
Void type.
Definition: Void.h:43
Test(const std::string &name)
Construct a test by name.
Definition: Test.h:145