CBMC
invariant.h
Go to the documentation of this file.
1 
3 #ifndef CPROVER_TESTING_UTILS_INVARIANT_H
4 #define CPROVER_TESTING_UTILS_INVARIANT_H
5 
7 
8 #include <string>
9 
10 class invariant_failedt;
11 
13  : public Catch::MatcherBase<invariant_failedt>
14 {
15 public:
16  explicit invariant_failure_containingt(std::string expected);
17  bool match(const invariant_failedt &exception) const override;
18  std::string describe() const override;
19 
20 private:
21  std::string expected;
22 };
23 
27 invariant_failure_containing(std::string expected);
28 
30 std::ostream &
31 operator<<(std::ostream &out, const invariant_failedt &invariant_failed);
32 
33 #endif // CPROVER_TESTING_UTILS_INVARIANT_H
A logic error, augmented with a distinguished field to hold a backtrace.
Definition: c_errors.h:28
bool match(const invariant_failedt &exception) const override
Definition: invariant.cpp:20
invariant_failure_containingt(std::string expected)
Definition: invariant.cpp:14
std::string describe() const override
Definition: invariant.cpp:27
std::ostream & operator<<(std::ostream &out, const invariant_failedt &invariant_failed)
Printing of invariant_failedt for test failure messages.
Definition: invariant.cpp:34
invariant_failure_containingt invariant_failure_containing(std::string expected)
Returns a matcher which matches an invariant_failedt exception, where the .what() returns a string co...
Definition: invariant.cpp:9