From d3b0b70fd34dad8e68c2922b9608628a6acb34af Mon Sep 17 00:00:00 2001
From: Matthias Maier <tamiko@kyomu.43-1.org>
Date: Fri, 19 Dec 2014 12:45:22 +0100
Subject: [PATCH] port other tests to new macro

---
 tests/hp/step-3c.cc              | 19 +++----------------
 tests/petsc/deal_solver_02.cc    | 19 +++----------------
 tests/trilinos/deal_solver_02.cc | 19 +++----------------
 3 files changed, 9 insertions(+), 48 deletions(-)

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;
-    }
 }
 
 
-- 
2.39.5