CBMC
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
12
#include <
util/symbol_table.h
>
13
17
const
symbolt
&
require_symbol::require_symbol_exists
(
18
const
symbol_tablet
&symbol_table,
19
const
irep_idt
&symbol_identifier)
20
{
21
const
symbolt
*found_symbol = symbol_table.
lookup
(symbol_identifier);
22
INFO(
"Looking for symbol: "
+
id2string
(symbol_identifier));
23
REQUIRE(found_symbol !=
nullptr
);
24
return
*found_symbol;
25
}
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition:
dstring.h:36
symbol_tablet
The symbol table.
Definition:
symbol_table.h:13
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:17
id2string
const std::string & id2string(const irep_idt &d)
Definition:
irep.h:47
require_symbol.h
symbolt
Symbol table entry.
Definition:
symbol.h:27
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
symbol_table.h
Author: Diffblue Ltd.
unit
testing-utils
require_symbol.cpp
Generated by
1.8.17