Skip to content

Commit 146502e

Browse files
author
thk123
committed
Simplify printing to use standard stream
1 parent 8027f84 commit 146502e

File tree

3 files changed

+5
-25
lines changed

3 files changed

+5
-25
lines changed

regression/cbmc-incr-oneloop/alarm2/test-json-output.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ main.c
44
^EXIT=10$
55
^SIGNAL=0$
66
"messageText": "VERIFICATION FAILED"
7-
"currentUnwinding": 1
7+
"current-unwinding": "1"
88
--
99
^warning: ignoring

regression/cbmc-incr-oneloop/alarm2/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CORE
22
main.c
33
--incremental-loop main.0 --unwind-min 5 --unwind-max 10
4-
Current unwinding: 1
4+
current-unwinding: 1
55
^EXIT=10$
66
^SIGNAL=0$
77
^VERIFICATION FAILED$

src/goto-checker/symex_bmc_incremental_one_loop.cpp

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -137,27 +137,7 @@ bool symex_bmc_incremental_one_loopt::resume(
137137
}
138138
void symex_bmc_incremental_one_loopt::log_unwinding(unsigned unwind)
139139
{
140-
const std::string unwind_num = std::to_string(unwind);
141-
switch(output_ui)
142-
{
143-
case ui_message_handlert::uit::PLAIN:
144-
{
145-
log.statistics() << "Current unwinding: " << unwind_num << messaget::eom;
146-
break;
147-
}
148-
case ui_message_handlert::uit::XML_UI:
149-
{
150-
xmlt xml("current-unwinding");
151-
xml.data = unwind_num;
152-
log.statistics() << xml << messaget::eom;
153-
break;
154-
}
155-
case ui_message_handlert::uit::JSON_UI:
156-
{
157-
json_objectt json;
158-
json["currentUnwinding"] = json_numbert(unwind_num);
159-
log.statistics() << json << messaget::eom;
160-
break;
161-
}
162-
}
140+
xmlt data{"current-unwinding"};
141+
data.data = std::to_string(unwind);
142+
log.statistics() << data;
163143
}

0 commit comments

Comments
 (0)