Skip to content

Commit 4cb4bc9

Browse files
tautschnigDaniel Kroening
authored and
Daniel Kroening
committed
Cleanup use of messaget in unit tests
Constructing a messaget without a message handler is deprecated. Don't unnecessarily include iostream, use a (null) message handler instead.
1 parent ddbefaa commit 4cb4bc9

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

jbmc/unit/solvers/strings/string_refinement/string_symbol_resolution.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Author: Diffblue Ltd.
77
88
\*******************************************************************/
99

10+
#include <testing-utils/message.h>
1011
#include <testing-utils/use_catch.h>
1112

1213
#include <solvers/strings/string_refinement.h>
@@ -27,7 +28,7 @@ SCENARIO(
2728
register_language(new_java_bytecode_language);
2829
symbol_tablet symbol_table;
2930
namespacet ns(symbol_table);
30-
messaget::mstreamt &stream = messaget().debug();
31+
messaget::mstreamt &stream = messaget(null_message_handler).debug();
3132

3233
GIVEN("Some equations")
3334
{

unit/analyses/dependence_graph.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ Author: Chris Smowton, [email protected]
66
77
\*******************************************************************/
88

9-
#include <iostream>
10-
11-
#include <analyses/dependence_graph.h>
12-
#include <ansi-c/ansi_c_language.h>
13-
#include <goto-programs/goto_convert_functions.h>
14-
#include <langapi/mode.h>
159
#include <testing-utils/call_graph_test_utils.h>
10+
#include <testing-utils/message.h>
1611
#include <testing-utils/use_catch.h>
12+
1713
#include <util/arith_tools.h>
1814
#include <util/c_types.h>
1915
#include <util/std_code.h>
2016
#include <util/symbol_table.h>
2117

18+
#include <analyses/dependence_graph.h>
19+
#include <ansi-c/ansi_c_language.h>
20+
#include <goto-programs/goto_convert_functions.h>
21+
#include <langapi/mode.h>
22+
2223
const std::set<goto_programt::const_targett>&
2324
dependence_graph_test_get_control_deps(const dep_graph_domaint &domain)
2425
{
@@ -83,8 +84,7 @@ SCENARIO("dependence_graph", "[core][analyses][dependence_graph]")
8384
goto_model.symbol_table.add(
8485
create_void_function_symbol("b", code_skipt()));
8586

86-
stream_message_handlert msg(std::cerr);
87-
goto_convert(goto_model, msg);
87+
goto_convert(goto_model, null_message_handler);
8888

8989
WHEN("Constructing a dependence graph")
9090
{

unit/util/message.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ TEST_CASE("Assign a messaget")
3838
messaget msg1(handler1);
3939

4040
// Assign messaget:
41-
messaget msg2;
41+
messaget msg2(handler1);
4242
msg2=msg1;
4343

4444
// Change its handler:

0 commit comments

Comments
 (0)