cprover
require_symbol.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Unit test utilities
4 
5 Author: Diffblue Limited.
6 
7 \*******************************************************************/
8 
9 #include "require_symbol.h"
10 #include "use_catch.h"
11 
16  const symbol_tablet &symbol_table,
17  const irep_idt &symbol_identifier)
18 {
19  const symbolt *found_symbol = symbol_table.lookup(symbol_identifier);
20  INFO("Looking for symbol: " + id2string(symbol_identifier));
21  REQUIRE(found_symbol != nullptr);
22  return *found_symbol;
23 }
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:37
symbol_tablet
The symbol table.
Definition: symbol_table.h:20
require_symbol::require_symbol_exists
const symbolt & require_symbol_exists(const symbol_tablet &symbol_table, const irep_idt &symbol_identifier)
Verify whether a given identifier is found in the symbol table and return it.
Definition: require_symbol.cpp:15
id2string
const std::string & id2string(const irep_idt &d)
Definition: irep.h:44
require_symbol.h
Helper functions for getting symbols from the symbol table during unit tests.
symbolt
Symbol table entry.
Definition: symbol.h:28
use_catch.h
symbol_table_baset::lookup
const symbolt * lookup(const irep_idt &name) const
Find a symbol in the symbol table for read-only access.
Definition: symbol_table_base.h:95