File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ SRC += analyses/ai/ai.cpp \
114
114
util/interval_union.cpp \
115
115
util/irep.cpp \
116
116
util/irep_sharing.cpp \
117
+ util/invariant.cpp \
117
118
util/json_array.cpp \
118
119
util/json_object.cpp \
119
120
util/lazy.cpp \
Original file line number Diff line number Diff line change
1
+ // Author: Diffblue Ltd.
2
+
3
+ // / \file Tests for macros in src/util/invariant.h
4
+
5
+ #include < testing-utils/invariant.h>
6
+ #include < testing-utils/use_catch.h>
7
+
8
+ #include < util/invariant.h>
9
+
10
+ TEST_CASE (" Using the UNIMPLEMENTED macro" , " [invariant]" )
11
+ {
12
+ cbmc_invariants_should_throwt invariants_throw;
13
+ REQUIRE_THROWS_MATCHES (
14
+ []() { UNIMPLEMENTED; }(),
15
+ invariant_failedt,
16
+ invariant_failure_containing (" Reason: Unimplemented" ));
17
+ }
18
+
19
+ TEST_CASE (" Using the UNIMPLEMENTED_FEATURE macro" , " [invariant]" )
20
+ {
21
+ cbmc_invariants_should_throwt invariants_throw;
22
+ REQUIRE_THROWS_MATCHES (
23
+ []() { UNIMPLEMENTED_FEATURE (" example" ); }(),
24
+ invariant_failedt,
25
+ invariant_failure_containing (" Reason: Reached unimplemented example" ));
26
+ }
You can’t perform that action at this time.
0 commit comments