From: heister Date: Thu, 19 Sep 2013 14:54:21 +0000 (+0000) Subject: tests: move cat_file to other header X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94708febf89a23e33b2e3db2dd13ce63e69291d1;p=dealii-svn.git tests: move cat_file to other header git-svn-id: https://svn.dealii.org/trunk@30827 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/mpi/coarse_grid_common.h b/tests/mpi/coarse_grid_common.h index a07b28d119..8590520d62 100644 --- a/tests/mpi/coarse_grid_common.h +++ b/tests/mpi/coarse_grid_common.h @@ -27,23 +27,6 @@ #include -// given the name of a file, copy it to deallog -// and then delete it -void cat_file(const char *filename) -{ - std::ifstream in(filename); - Assert (in, ExcIO()); - - while (in) - { - std::string s; - std::getline(in, s); - deallog.get_file_stream() << s << "\n"; - } - in.close(); - - std::remove (filename); -} template diff --git a/tests/tests.h b/tests/tests.h index 9378b1bf29..0bb6b97f58 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -33,6 +33,25 @@ #include +// given the name of a file, copy it to deallog +// and then delete it +inline void cat_file(const char *filename) +{ + std::ifstream in(filename); + Assert (in, dealii::ExcIO()); + + while (in) + { + std::string s; + std::getline(in, s); + dealii::deallog.get_file_stream() << s << "\n"; + } + in.close(); + + std::remove (filename); +} + + #ifdef DEAL_II_WITH_PETSC #include