File: require_expr.h

package info (click to toggle)
cbmc 6.6.0-4
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 153,852 kB
  • sloc: cpp: 386,459; ansic: 114,466; java: 28,405; python: 6,003; yacc: 4,552; makefile: 4,041; lex: 2,487; xml: 2,388; sh: 2,050; perl: 557; pascal: 184; javascript: 163; ada: 36
file content (41 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*******************************************************************\

Module: Unit test utilities

Author: Diffblue Ltd.

\*******************************************************************/

/// \file
/// Helper functions for requiring specific expressions
/// If the expression is of the wrong type, throw a CATCH exception
/// Also checks associated properties and returns a casted version of the
/// expression.

#ifndef CPROVER_TESTING_UTILS_REQUIRE_EXPR_H
#define CPROVER_TESTING_UTILS_REQUIRE_EXPR_H

#include <util/std_code.h>

// NOLINTNEXTLINE(readability/namespace)
namespace require_expr
{
  index_exprt require_index(const exprt &expr, int expected_index);
  index_exprt require_top_index(const exprt &expr);

  member_exprt require_member(
    const exprt &expr, const irep_idt &component_identifier);

  symbol_exprt require_symbol(
    const exprt &expr, const irep_idt &symbol_name);

  symbol_exprt require_symbol(const exprt &expr);

  typecast_exprt require_typecast(const exprt &expr);

  side_effect_exprt require_side_effect_expr(
    const exprt &expr,
    const irep_idt &side_effect_statement);
}

#endif // CPROVER_TESTING_UTILS_REQUIRE_EXPR_H