Skip to content

Commit a5ce621

Browse files
committed
Make unit tests quiet
Two of the unit tests previously produced output, which rendered unit tests noisy with no validation value (the generated text was not inspected). Fixes: diffblue#2372
1 parent 7bfd36b commit a5ce621

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

unit/goto-programs/goto_trace_output.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <testing-utils/catch.hpp>
1010
#include <goto-programs/goto_program.h>
1111
#include <goto-programs/goto_trace.h>
12-
#include <iostream>
12+
#include <sstream>
1313

1414
SCENARIO(
1515
"Output trace with nil lhs object",
@@ -22,5 +22,16 @@ SCENARIO(
2222
goto_trace_stept step;
2323
step.pc = instructions.begin();
2424
step.type = goto_trace_stept::typet::ATOMIC_BEGIN;
25-
step.output(ns, std::cout);
25+
26+
std::ostringstream oss;
27+
step.output(ns, oss);
28+
29+
std::istringstream iss(oss.str());
30+
std::string line;
31+
std::getline(iss, line);
32+
REQUIRE(line == "*** ATOMIC_BEGIN");
33+
std::getline(iss, line);
34+
REQUIRE(line == "OTHER");
35+
std::getline(iss, line);
36+
REQUIRE(line.empty());
2637
}

unit/path_strategies.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ void _check_with_strategy(
314314
}
315315

316316
ui_message_handlert mh(cmdline, "path-explore");
317+
mh.set_verbosity(0);
317318
messaget log(mh);
318319

319320
path_strategy_choosert chooser;

0 commit comments

Comments
 (0)