scsl  1.1.1
Shimmering Clarity Standard Library
Exceptions.h
Go to the documentation of this file.
1 
23 #ifndef SCSL_EXCEPTIONS_H
24 #define SCSL_EXCEPTIONS_H
25 
26 
27 #include <exception>
28 #include <string>
29 
30 
31 namespace sctest {
32 
33 
38 class NotImplemented : public std::exception {
39 public:
41  explicit NotImplemented(const char *pl) : platform((char *)pl) {}
42 
44  const char *what() const throw() {
45  return this->platform;
46  }
47 private:
48  char *platform;
49 };
50 
51 
53 class AssertionFailed : public std::exception {
54 public:
57  explicit AssertionFailed(std::string message);
58 
60  const char *what() const throw();
61 
62 private:
63  std::string msg;
64 };
65 
66 
67 } // namespace sctest
68 
69 
70 #endif // SCSL_EXCEPTIONS_H
AssertionFailed indicates that some invariant didn't hold.
Definition: Exceptions.h:53
AssertionFailed(std::string message)
const char * what() const
what returns a message describing the exception.
Exception reserved for unsupported platforms.
Definition: Exceptions.h:38
NotImplemented(const char *pl)
NotImplemented exceptions are constructed with a platform name.
Definition: Exceptions.h:41
const char * what() const
what returns a message naming the platform.
Definition: Exceptions.h:44
Shimmering Clarity testing library.
Definition: sctest.h:34