File tree 4 files changed +23
-2
lines changed 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ class smt2_convt : public stack_decision_proceduret
82
82
83
83
std::size_t get_number_of_solver_calls () const override ;
84
84
85
+ static std::string convert_identifier (const irep_idt &identifier);
86
+
85
87
protected:
86
88
const namespacet &ns;
87
89
std::ostream &out;
@@ -136,8 +138,6 @@ class smt2_convt : public stack_decision_proceduret
136
138
void convert_with (const with_exprt &expr);
137
139
void convert_update (const exprt &expr);
138
140
139
- std::string convert_identifier (const irep_idt &identifier);
140
-
141
141
void convert_expr (const exprt &);
142
142
void convert_type (const typet &);
143
143
void convert_literal (const literalt);
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ SRC += analyses/ai/ai.cpp \
84
84
solvers/sat/external_sat.cpp \
85
85
solvers/sat/satcheck_cadical.cpp \
86
86
solvers/sat/satcheck_minisat2.cpp \
87
+ solvers/smt2/smt2_conv.cpp \
87
88
solvers/strings/array_pool/array_pool.cpp \
88
89
solvers/strings/string_constraint_generator_valueof/calculate_max_string_length.cpp \
89
90
solvers/strings/string_constraint_generator_valueof/get_numeric_value_from_character.cpp \
Original file line number Diff line number Diff line change
1
+ solvers/smt2
2
+ testing-utils
Original file line number Diff line number Diff line change
1
+ // Author: Diffblue Ltd.
2
+
3
+ #include < testing-utils/use_catch.h>
4
+
5
+ #include < solvers/smt2/smt2_conv.h>
6
+
7
+ TEST_CASE (
8
+ " smt2_convt::convert_identifier character escaping." ,
9
+ " [core][solvers][smt2]" )
10
+ {
11
+ const auto no_escaping_characters = " abcdefghijklmnopqrstuvwxyz0123456789$" ;
12
+ CHECK (
13
+ smt2_convt::convert_identifier (no_escaping_characters) ==
14
+ no_escaping_characters);
15
+ CHECK (smt2_convt::convert_identifier (" \\ " ) == " &92;" );
16
+ CHECK (smt2_convt::convert_identifier (" |" ) == " &124;" );
17
+ CHECK (smt2_convt::convert_identifier (" &" ) == " &38;" );
18
+ }
You can’t perform that action at this time.
0 commit comments