#ifndef MSP_TEST_EXCEPTIONCHECK_H_
#define MSP_TEST_EXCEPTIONCHECK_H_
+#include <typeinfo>
+
namespace Msp {
namespace Test {
{
protected:
ExceptionCheck() { }
-
public:
+ virtual ~ExceptionCheck() { }
+
virtual bool check(const std::exception &) const = 0;
+ virtual const std::type_info &get_type_info() const = 0;
};
template<typename T>
public:
virtual bool check(const std::exception &e) const
{ return dynamic_cast<const T *>(&e); }
+
+ virtual const std::type_info &get_type_info() const
+ { return typeid(T); }
};
} // namespace Test