]> git.tdb.fi Git - libs/test.git/blob - source/exceptioncheck.h
Initial commit
[libs/test.git] / source / exceptioncheck.h
1 #ifndef MSP_TEST_EXCEPTIONCHECK_H_
2 #define MSP_TEST_EXCEPTIONCHECK_H_
3
4 namespace Msp {
5 namespace Test {
6
7 class ExceptionCheck
8 {
9 protected:
10         ExceptionCheck() { }
11
12 public:
13         virtual bool check(const std::exception &) const = 0;
14 };
15
16 template<typename T>
17 class ExceptionTypeCheck: public ExceptionCheck
18 {
19 public:
20         virtual bool check(const std::exception &e) const
21         { return dynamic_cast<const T *>(&e); }
22 };
23
24 } // namespace Test
25 } // namespace Msp
26
27 #endif