File: does_remove_const_util.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 (49 lines) | stat: -rw-r--r-- 1,344 bytes parent folder | download | duplicates (2)
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
42
43
44
45
46
47
48
49
/*******************************************************************\

Module: Does Remove Const Unit Tests

Author: Diffblue Ltd.

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

/// \file
/// Does Remove Const Unit Tests

#ifndef CPROVER__ANALYSES_DOES_REMOVE_CONST_DOES_REMOVE_CONST_UTIL_H
#define CPROVER__ANALYSES_DOES_REMOVE_CONST_DOES_REMOVE_CONST_UTIL_H

#include <analyses/does_remove_const.h>

// This class provides access to private members and functions of
// does_remove_const
class does_remove_const_testt
{
public:
  explicit does_remove_const_testt(does_remove_constt does_remove_const):
    does_remove_const(does_remove_const)
  {}

  bool does_expr_lose_const(const exprt &expr) const
  {
    return does_remove_const.does_expr_lose_const(expr);
  }

  bool is_type_at_least_as_const_as(
    const typet &type_more_const, const typet &type_compare) const
  {
    return does_remove_const.is_type_at_least_as_const_as(
      type_more_const, type_compare);
  }

  bool does_type_preserve_const_correctness(
    const typet *target_type, const typet *source_type) const
  {
    return does_remove_const.does_type_preserve_const_correctness(
      target_type, source_type);
  }

private:
  does_remove_constt does_remove_const;
};

#endif // CPROVER__ANALYSES_DOES_REMOVE_CONST_DOES_REMOVE_CONST_UTIL_H