From be0ba8991e59c667f5707e143ed7296a08ff72f0 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Fri, 7 Jul 2023 01:29:53 -0500 Subject: [PATCH] example_test.h: add ostream parameter for solver_within_range macro --- tests/examples/example_test.h | 42 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/tests/examples/example_test.h b/tests/examples/example_test.h index b5de81726a..3e45b7c9b4 100644 --- a/tests/examples/example_test.h +++ b/tests/examples/example_test.h @@ -50,28 +50,26 @@ cat_file(const char *filename) * steps. */ -#define check_solver_within_range(SolverType_COMMAND, \ - CONTROL_COMMAND, \ - MIN_ALLOWED, \ - MAX_ALLOWED) \ - { \ - try \ - { \ - SolverType_COMMAND; \ - } \ - catch (SolverControl::NoConvergence & exc) \ - {} \ - const unsigned int steps = CONTROL_COMMAND; \ - if (steps >= MIN_ALLOWED && steps <= MAX_ALLOWED) \ - { \ - std::cout << "Solver stopped within " << MIN_ALLOWED << " - " \ - << MAX_ALLOWED << " iterations" << std::endl; \ - } \ - else \ - { \ - std::cout << "Solver stopped after " << steps << " iterations" \ - << std::endl; \ - } \ +#define check_solver_within_range( \ + OSTREAM, SolverType_COMMAND, CONTROL_COMMAND, MIN_ALLOWED, MAX_ALLOWED) \ + { \ + try \ + { \ + SolverType_COMMAND; \ + } \ + catch (SolverControl::NoConvergence & exc) \ + {} \ + const unsigned int steps = CONTROL_COMMAND; \ + if (steps >= MIN_ALLOWED && steps <= MAX_ALLOWED) \ + { \ + OSTREAM << "Solver stopped within " << MIN_ALLOWED << " - " \ + << MAX_ALLOWED << " iterations" << std::endl; \ + } \ + else \ + { \ + OSTREAM << "Solver stopped after " << steps << " iterations" \ + << std::endl; \ + } \ } -- 2.39.5