1 #ifndef MSP_TEST_TESTFUNCTION_H_
2 #define MSP_TEST_TESTFUNCTION_H_
5 #include "exceptioncheck.h"
15 std::string description;
16 ExceptionCheck *exc_check;
19 Function(const std::string &);
23 const std::string &get_description() const { return description; }
26 Function &expect_throw() { exc_check = new ExceptionTypeCheck<T>; return *this; }
28 const ExceptionCheck *get_exception_check() const { return exc_check; }
30 virtual void run(Test &) const = 0;
34 class TypedFunction: public Function
37 typedef void (T::*FuncPtr)();
42 TypedFunction(FuncPtr f, const std::string & d):
47 virtual void run(Test &t) const
49 (dynamic_cast<T &>(t).*func)();