From: Matthias Maier Date: Fri, 7 Jul 2023 06:29:53 +0000 (-0500) Subject: example_test.h: add ostream parameter for solver_within_range macro X-Git-Tag: relicensing~728^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be0ba8991e59c667f5707e143ed7296a08ff72f0;p=dealii.git example_test.h: add ostream parameter for solver_within_range macro --- 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; \ + } \ }