From: Matthias Maier Date: Fri, 19 Dec 2014 11:45:22 +0000 (+0100) Subject: port other tests to new macro X-Git-Tag: v8.3.0-rc1~595^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F361%2Fhead;p=dealii.git port other tests to new macro --- diff --git a/tests/hp/step-3c.cc b/tests/hp/step-3c.cc index 947e32cefc..34511de72b 100644 --- a/tests/hp/step-3c.cc +++ b/tests/hp/step-3c.cc @@ -225,22 +225,9 @@ void LaplaceProblem::solve () SolverControl solver_control (1000, 1e-6); SolverCG<> cg (solver_control); - deallog.depth_file(0); - cg.solve (system_matrix, solution, system_rhs, - PreconditionIdentity()); - deallog.depth_file(3); - - const unsigned int steps = solver_control.last_step(); - if (steps >= 629 && steps <= 630) - { - deallog << "Solver stopped within 629 - 630 iterations" - << std::endl; - } - else - { - deallog << "Solver stopped after " << steps << " iterations" - << std::endl; - } + check_solver_within_range( + cg.solve(system_matrix, solution, system_rhs, PreconditionIdentity()), + solver_control.last_step(), 629, 630); solution.print (deallog.get_file_stream()); diff --git a/tests/petsc/deal_solver_02.cc b/tests/petsc/deal_solver_02.cc index b45cb28dff..0ef008f3e7 100644 --- a/tests/petsc/deal_solver_02.cc +++ b/tests/petsc/deal_solver_02.cc @@ -51,28 +51,15 @@ check_solve( SOLVER &solver, f = 1.; try { - deallog.depth_file(0); - solver.solve(A,u,f,P); - deallog.depth_file(3); + check_solver_within_range( + solver.solve(A,u,f,P), + solver_control.last_step(), 49, 51); } catch (std::exception &e) { - deallog.depth_file(3); deallog << e.what() << std::endl; abort (); } - - const unsigned int steps = solver_control.last_step(); - if (steps >= 49 && steps <= 51) - { - deallog << "Solver stopped within 49 - 51 iterations" - << std::endl; - } - else - { - deallog << "Solver stopped after " << solver_control.last_step() - << " iterations" << std::endl; - } } diff --git a/tests/trilinos/deal_solver_02.cc b/tests/trilinos/deal_solver_02.cc index 6457179c2e..c42605c75b 100644 --- a/tests/trilinos/deal_solver_02.cc +++ b/tests/trilinos/deal_solver_02.cc @@ -52,28 +52,15 @@ check_solve( SOLVER &solver, f = 1.; try { - deallog.depth_file(0); - solver.solve(A,u,f,P); - deallog.depth_file(3); + check_solver_within_range( + solver.solve(A,u,f,P), + solver_control.last_step(), 49, 51); } catch (std::exception &e) { - deallog.depth_file(3); deallog << e.what() << std::endl; abort (); } - - const unsigned int steps = solver_control.last_step(); - if (steps >= 49 && steps <= 51) - { - deallog << "Solver stopped within 49 - 51 iterations" - << std::endl; - } - else - { - deallog << "Solver stopped after " << solver_control.last_step() - << " iterations" << std::endl; - } }