File tree 2 files changed +50
-0
lines changed
2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* ******************************************************************\
2
+
3
+ Module: Unit test utilities
4
+
5
+ Author: DiffBlue Limited. All rights reserved.
6
+
7
+ \*******************************************************************/
8
+
9
+
10
+ #include " require_symbol.h"
11
+ #include " catch.hpp"
12
+
13
+ // / Verify whether a given identifier is found in the symbol table and return it
14
+ // / \param symbol_table: The symbol table to look in
15
+ // / \param symbol_identifier: The name of the symbol
16
+ const symbolt &require_symbol::require_symbol_exists (
17
+ const symbol_tablet &symbol_table,
18
+ const irep_idt &symbol_identifier)
19
+ {
20
+ const symbolt *found_symbol=symbol_table.lookup (symbol_identifier);
21
+ INFO (" Looking for symbol: " + id2string (symbol_identifier));
22
+ REQUIRE (found_symbol != nullptr );
23
+ return *found_symbol;
24
+ }
Original file line number Diff line number Diff line change
1
+ /* ******************************************************************\
2
+
3
+ Module: Unit test utilities
4
+
5
+ Author: DiffBlue Limited. All rights reserved.
6
+
7
+ \*******************************************************************/
8
+
9
+ #ifndef CPROVER_TESTING_UTILS_REQUIRE_SYMBOL_H
10
+ #define CPROVER_TESTING_UTILS_REQUIRE_SYMBOL_H
11
+
12
+ #include < util/symbol.h>
13
+ #include < util/symbol_table.h>
14
+
15
+ // / \file
16
+ // / Helper functions for getting symbols from the symbol table during unit tests
17
+
18
+ // NOLINTNEXTLINE(readability/namespace)
19
+ namespace require_symbol
20
+ {
21
+ const symbolt &require_symbol_exists (
22
+ const symbol_tablet &symbol_table,
23
+ const irep_idt &symbol_identifier);
24
+ }
25
+
26
+ #endif // CPROVER_TESTING_UTILS_REQUIRE_SYMBOL_H
You can’t perform that action at this time.
0 commit comments