From: Wolfgang Bangerth Date: Mon, 21 Aug 2017 16:28:12 +0000 (-0600) Subject: Update the style of tests. X-Git-Tag: v9.0.0-rc1~1192^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5128e7fd644ed4cb9861dcdf52a5688698ef1687;p=dealii.git Update the style of tests. While there, also update a couple of outdated comments. --- diff --git a/tests/distributed_grids/2d_dofhandler_01.cc b/tests/distributed_grids/2d_dofhandler_01.cc index aee31ec4c3..46d25a088e 100644 --- a/tests/distributed_grids/2d_dofhandler_01.cc +++ b/tests/distributed_grids/2d_dofhandler_01.cc @@ -36,7 +36,7 @@ template -void test(std::ostream & /*out*/) +void test() { deallog << "hyper_cube" << std::endl; @@ -75,11 +75,10 @@ int main(int argc, char *argv[]) { Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog(); deallog.push("2d"); - test<2>(logfile); + test<2>(); deallog.pop(); diff --git a/tests/distributed_grids/count_dofs_per_block_01.cc b/tests/distributed_grids/count_dofs_per_block_01.cc index 699ead3425..d2caaa71da 100644 --- a/tests/distributed_grids/count_dofs_per_block_01.cc +++ b/tests/distributed_grids/count_dofs_per_block_01.cc @@ -105,12 +105,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); -#else - (void)argc; - (void)argv; -#endif unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) diff --git a/tests/distributed_grids/count_dofs_per_component_01.cc b/tests/distributed_grids/count_dofs_per_component_01.cc index c432defbd8..9c1ab47c58 100644 --- a/tests/distributed_grids/count_dofs_per_component_01.cc +++ b/tests/distributed_grids/count_dofs_per_component_01.cc @@ -71,12 +71,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); -#else - (void)argc; - (void)argv; -#endif unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) diff --git a/tests/distributed_grids/dof_handler_number_cache.cc b/tests/distributed_grids/dof_handler_number_cache.cc index b1c62bd727..c2a9a502cc 100644 --- a/tests/distributed_grids/dof_handler_number_cache.cc +++ b/tests/distributed_grids/dof_handler_number_cache.cc @@ -15,7 +15,7 @@ -// like the same test in deal.II but this time use a +// like the dofs/dof_handler_number_cache test but this time use a // parallel::distributed::Triangulation object. We still use only a // single processor so the end result should be the same but we use // entirely different code paths @@ -107,12 +107,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); -#else - (void)argc; - (void)argv; -#endif unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) diff --git a/tests/distributed_grids/hp_2d_dofhandler_01.cc b/tests/distributed_grids/hp_2d_dofhandler_01.cc index 480e695238..d04bdfa70e 100644 --- a/tests/distributed_grids/hp_2d_dofhandler_01.cc +++ b/tests/distributed_grids/hp_2d_dofhandler_01.cc @@ -41,7 +41,7 @@ template -void test(std::ostream & /*out*/) +void test() { deallog << "hyper_cube" << std::endl; @@ -81,12 +81,9 @@ int main(int argc, char *argv[]) { Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); - std::ofstream logfile("output"); - deallog.attach(logfile); + initlog (); deallog.push("2d"); - test<2>(logfile); + test<2>(); deallog.pop(); - - } diff --git a/tests/distributed_grids/hp_count_dofs_per_block_01.cc b/tests/distributed_grids/hp_count_dofs_per_block_01.cc index 928bb688f6..4fefc18585 100644 --- a/tests/distributed_grids/hp_count_dofs_per_block_01.cc +++ b/tests/distributed_grids/hp_count_dofs_per_block_01.cc @@ -112,12 +112,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); -#else - (void)argc; - (void)argv; -#endif unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) diff --git a/tests/distributed_grids/hp_count_dofs_per_component_01.cc b/tests/distributed_grids/hp_count_dofs_per_component_01.cc index e1bbdbdf5e..1e7401b19b 100644 --- a/tests/distributed_grids/hp_count_dofs_per_component_01.cc +++ b/tests/distributed_grids/hp_count_dofs_per_component_01.cc @@ -78,12 +78,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); -#else - (void)argc; - (void)argv; -#endif unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) diff --git a/tests/distributed_grids/hp_dof_handler_number_cache.cc b/tests/distributed_grids/hp_dof_handler_number_cache.cc index f5ae269504..45bf55e0bf 100644 --- a/tests/distributed_grids/hp_dof_handler_number_cache.cc +++ b/tests/distributed_grids/hp_dof_handler_number_cache.cc @@ -15,7 +15,7 @@ -// like the same test in deal.II but this time use a +// like the dofs/dof_handler_number_cache test but this time use a // parallel::distributed::Triangulation object. We still use only a // single processor so the end result should be the same but we use // entirely different code paths @@ -114,12 +114,7 @@ void test() int main(int argc, char *argv[]) { -#ifdef DEAL_II_WITH_MPI Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); -#else - (void)argc; - (void)argv; -#endif unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0)