CBMC
require_expr.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Unit test utilities
4 
5 Author: Diffblue Ltd.
6 
7 \*******************************************************************/
8 
14 
15 #ifndef CPROVER_TESTING_UTILS_REQUIRE_EXPR_H
16 #define CPROVER_TESTING_UTILS_REQUIRE_EXPR_H
17 
18 #include <util/std_code.h>
19 
20 // NOLINTNEXTLINE(readability/namespace)
21 namespace require_expr
22 {
23  index_exprt require_index(const exprt &expr, int expected_index);
24  index_exprt require_top_index(const exprt &expr);
25 
27  const exprt &expr, const irep_idt &component_identifier);
28 
30  const exprt &expr, const irep_idt &symbol_name);
31 
32  symbol_exprt require_symbol(const exprt &expr);
33 
35 
37  const exprt &expr,
38  const irep_idt &side_effect_statement);
39 }
40 
41 #endif // CPROVER_TESTING_UTILS_REQUIRE_EXPR_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
Base class for all expressions.
Definition: expr.h:56
Array index operator.
Definition: std_expr.h:1465
Extract member of struct or union.
Definition: std_expr.h:2841
An expression containing a side effect.
Definition: std_code.h:1450
Expression to hold a symbol (variable)
Definition: std_expr.h:131
Semantic type conversion.
Definition: std_expr.h:2068
side_effect_exprt require_side_effect_expr(const exprt &expr, const irep_idt &side_effect_statement)
Verify a given exprt is a side_effect_exprt with appropriate statement.
typecast_exprt require_typecast(const exprt &expr)
Verify a given exprt is a typecast_expr.
index_exprt require_index(const exprt &expr, int expected_index)
Verify a given exprt is an index_exprt with a a constant value equal to the expected value.
member_exprt require_member(const exprt &expr, const irep_idt &component_identifier)
Verify a given exprt is an member_exprt with a component name equal to the component_identifier.
index_exprt require_top_index(const exprt &expr)
Verify a given exprt is an index_exprt with a nil value as its index.
symbol_exprt require_symbol(const exprt &expr, const irep_idt &symbol_name)
Verify a given exprt is an symbol_exprt with a identifier name equal to the symbol_name.