From: bangerth Date: Tue, 8 Oct 2013 12:41:27 +0000 (+0000) Subject: Run second part of test only if it's different from the first. Adjust test output. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c1fbbd995ee823e774ae9440f7983094aec03b4;p=dealii-svn.git Run second part of test only if it's different from the first. Adjust test output. git-svn-id: https://svn.dealii.org/trunk@31169 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/source/base/path_search.cc b/deal.II/source/base/path_search.cc index 4f0faa9b8c..eaa59d4ff0 100644 --- a/deal.II/source/base/path_search.cc +++ b/deal.II/source/base/path_search.cc @@ -146,22 +146,24 @@ PathSearch::find (const std::string &filename, } } - // try again with the suffix appended - { - real_name = *path + filename + suffix; - if (debug > 1) - deallog << "PathSearch[" << cls << "] trying " - << real_name << std::endl; - FILE *fp = fopen(real_name.c_str(), open_mode); - if (fp != 0) - { - if (debug > 0) - deallog << "PathSearch[" << cls << "] opened " - << real_name << std::endl; - fclose(fp); - return real_name; - } - } + // try again with the suffix appended, unless there is + // no suffix + if (suffix != "") + { + real_name = *path + filename + suffix; + if (debug > 1) + deallog << "PathSearch[" << cls << "] trying " + << real_name << std::endl; + FILE *fp = fopen(real_name.c_str(), open_mode); + if (fp != 0) + { + if (debug > 0) + deallog << "PathSearch[" << cls << "] opened " + << real_name << std::endl; + fclose(fp); + return real_name; + } + } } AssertThrow(false, ExcFileNotFound(filename, cls)); return std::string(""); diff --git a/tests/base/path_search/cmp/generic b/tests/base/path_search/cmp/generic index fda4b157f3..f7448712a2 100644 --- a/tests/base/path_search/cmp/generic +++ b/tests/base/path_search/cmp/generic @@ -17,8 +17,11 @@ DEAL::PathSearch[CC] trying ../scripts/tests DEAL::PathSearch[CC] trying tests DEAL::PathSearch[CC] trying ../tests DEAL::PathSearch[CC] 3 directories +DEAL::PathSearch[CC] trying ../scripts/tests DEAL::PathSearch[CC] trying ../scripts/tests.h +DEAL::PathSearch[CC] trying tests DEAL::PathSearch[CC] trying tests.h +DEAL::PathSearch[CC] trying ../tests DEAL::PathSearch[CC] trying ../tests.h DEAL::PathSearch[CC] opened ../tests.h DEAL::../tests.h @@ -31,25 +34,39 @@ DEAL::PathSearch[MESH] 2 directories DEAL::PathSearch[MESH] trying grid_in_msh_01.2d DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d DEAL::PathSearch[MESH] 2 directories +DEAL::PathSearch[MESH] trying grid_in_msh_01.2d DEAL::PathSearch[MESH] trying grid_in_msh_01.2d.inp +DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d.inp DEAL::PathSearch[MESH] 2 directories +DEAL::PathSearch[MESH] trying grid_in_msh_01.2d DEAL::PathSearch[MESH] trying grid_in_msh_01.2d.xda +DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d.xda DEAL::PathSearch[MESH] 2 directories +DEAL::PathSearch[MESH] trying grid_in_msh_01.2d DEAL::PathSearch[MESH] trying grid_in_msh_01.2d.dbmesh +DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d.dbmesh DEAL::PathSearch[MESH] 2 directories +DEAL::PathSearch[MESH] trying grid_in_msh_01.2d DEAL::PathSearch[MESH] trying grid_in_msh_01.2d.dat +DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d.dat DEAL::PathSearch[MESH] 2 directories +DEAL::PathSearch[MESH] trying grid_in_msh_01.2d DEAL::PathSearch[MESH] trying grid_in_msh_01.2d.plt +DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d.plt DEAL::PathSearch[MESH] 2 directories +DEAL::PathSearch[MESH] trying grid_in_msh_01.2d DEAL::PathSearch[MESH] trying grid_in_msh_01.2d.nc +DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d.nc DEAL::PathSearch[MESH] 2 directories +DEAL::PathSearch[MESH] trying grid_in_msh_01.2d DEAL::PathSearch[MESH] trying grid_in_msh_01.2d.msh +DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d DEAL::PathSearch[MESH] trying ../bits/grid_in_msh_01.2d.msh DEAL::PathSearch[MESH] opened ../bits/grid_in_msh_01.2d.msh DEAL:: $NOD 4 1 0