File tree 4 files changed +42
-62
lines changed
4 files changed +42
-62
lines changed Original file line number Diff line number Diff line change @@ -14,34 +14,10 @@ Module: Unit test for call graph generation
14
14
#include < analyses/call_graph_helpers.h>
15
15
16
16
#include < util/symbol_table.h>
17
- #include < util/std_code.h>
18
17
19
18
#include < goto-programs/goto_convert_functions.h>
20
19
21
- static symbolt create_void_function_symbol (
22
- const irep_idt &name,
23
- const codet &code)
24
- {
25
- const code_typet void_function_type ({}, empty_typet ());
26
- symbolt function;
27
- function.name =name;
28
- function.type =void_function_type;
29
- function.mode =ID_java;
30
- function.value =code;
31
- return function;
32
- }
33
-
34
- static bool multimap_key_matches (
35
- const std::multimap<irep_idt, irep_idt> &map,
36
- const irep_idt &key,
37
- const std::set<irep_idt> &values)
38
- {
39
- auto matching_values=map.equal_range (key);
40
- std::set<irep_idt> matching_set;
41
- for (auto it=matching_values.first ; it!=matching_values.second ; ++it)
42
- matching_set.insert (it->second );
43
- return matching_set==values;
44
- }
20
+ #include " call_graph_test_utils.h"
45
21
46
22
SCENARIO (" call_graph" ,
47
23
" [core][util][call_graph]" )
Original file line number Diff line number Diff line change
1
+ /*
2
+ * call_graph_test_utils.h
3
+ *
4
+ * Created on: 25 Jun 2018
5
+ * Author: polgreen
6
+ */
7
+
8
+ #ifndef CPROVER_ANALYSES_CALL_GRAPH_TEST_UTILS_H
9
+ #define CPROVER_ANALYSES_CALL_GRAPH_TEST_UTILS_H
10
+
11
+ #include < analyses/call_graph.h>
12
+
13
+ #include < util/std_code.h>
14
+
15
+ static symbolt
16
+ create_void_function_symbol (const irep_idt &name, const codet &code)
17
+ {
18
+ const code_typet void_function_type ({}, empty_typet ());
19
+ symbolt function;
20
+ function.name = name;
21
+ function.type = void_function_type;
22
+ function.mode = ID_java;
23
+ function.value = code;
24
+ return function;
25
+ }
26
+
27
+ static bool multimap_key_matches (
28
+ const std::multimap<irep_idt, irep_idt> &map,
29
+ const irep_idt &key,
30
+ const std::set<irep_idt> &values)
31
+ {
32
+ auto matching_values = map.equal_range (key);
33
+ std::set<irep_idt> matching_set;
34
+ for (auto it = matching_values.first ; it != matching_values.second ; ++it)
35
+ matching_set.insert (it->second );
36
+ return matching_set == values;
37
+ }
38
+
39
+ #endif /* CPROVER_ANALYSES_CALL_GRAPH_TEST_UTILS_H */
Original file line number Diff line number Diff line change 18
18
#include < langapi/mode.h>
19
19
#include < ansi-c/ansi_c_language.h>
20
20
21
- static symbolt create_void_function_symbol (
22
- const irep_idt &name,
23
- const codet &code)
24
- {
25
- const code_typet void_function_type ({}, empty_typet ());
26
- symbolt function;
27
- function.name = name;
28
- function.type = void_function_type;
29
- function.mode = ID_java;
30
- function.value = code;
31
- return function;
32
- }
21
+ #include " call_graph_test_utils.h"
33
22
34
23
const std::set<goto_programt::const_targett>&
35
24
dependence_graph_test_get_control_deps (const dep_graph_domaint &domain)
Original file line number Diff line number Diff line change @@ -10,37 +10,13 @@ Module: Unit test for graph class functions
10
10
11
11
#include < testing-utils/catch.hpp>
12
12
13
- #include < analyses/call_graph.h>
14
13
#include < analyses/call_graph_helpers.h>
15
14
16
- #include < util/std_code.h>
17
15
#include < util/symbol_table.h>
18
16
19
17
#include < goto-programs/goto_convert_functions.h>
20
18
21
- static symbolt
22
- create_void_function_symbol (const irep_idt &name, const codet &code)
23
- {
24
- const code_typet void_function_type ({}, empty_typet ());
25
- symbolt function;
26
- function.name = name;
27
- function.type = void_function_type;
28
- function.mode = ID_java;
29
- function.value = code;
30
- return function;
31
- }
32
-
33
- static bool multimap_key_matches (
34
- const std::multimap<irep_idt, irep_idt> &map,
35
- const irep_idt &key,
36
- const std::set<irep_idt> &values)
37
- {
38
- auto matching_values = map.equal_range (key);
39
- std::set<irep_idt> matching_set;
40
- for (auto it = matching_values.first ; it != matching_values.second ; ++it)
41
- matching_set.insert (it->second );
42
- return matching_set == values;
43
- }
19
+ #include " call_graph_test_utils.h"
44
20
45
21
SCENARIO (" graph" , " [core][util][graph]" )
46
22
{
You can’t perform that action at this time.
0 commit comments