[Dune] [Dune-Commit] dune-grid r5936 - trunk/dune/grid/io/file/test

Christian Engwer christi at uni-hd.de
Fri Nov 13 16:16:33 CET 2009


Dear all,

On Fri, Nov 13, 2009 at 03:34:27PM +0100, robertk at dune-project.org wrote:
> Author: robertk
> Date: 2009-11-13 15:34:27 +0100 (Fri, 13 Nov 2009)
> New Revision: 5936
> 
> Modified:
>    trunk/dune/grid/io/file/test/gmshtest.cc
> Log:
> make work, path was wrong. Also: don't use HAVE_...
> use ENABLE_...

it seems there is a misunderstanding of the semantics of the

HAVE_FOOBAR

preprocessor macros.

HAVE_FOOBAR is supposed to be either false or true. It might be
undefined which is equivalent to false. Thus the correct usage is 

#if HAVE_FOOBAR instead of 
#idef HAVE_FOOBAR. ENABLE_FOOBAR is not intended for the user. It is
only trick to move the final definition of HAVE_FOOBAR to the
commandline.

Christian

> 
> 
> 
> Modified: trunk/dune/grid/io/file/test/gmshtest.cc
> ===================================================================
> --- trunk/dune/grid/io/file/test/gmshtest.cc	2009-11-13 14:33:50 UTC (rev 5935)
> +++ trunk/dune/grid/io/file/test/gmshtest.cc	2009-11-13 14:34:27 UTC (rev 5936)
> @@ -1,13 +1,13 @@
>  #include "config.h"
>  
>  #include <dune/grid/sgrid.hh>
> -#ifdef HAVE_UG
> +#ifdef ENABLE_UG
>  #include <dune/grid/uggrid.hh>
>  #endif
> -#ifdef HAVE_ALBERTA
> +#ifdef ENABLE_ALBERTA
>  #include <dune/grid/albertagrid.hh>
>  #endif
> -#ifdef HAVE_ALUGRID
> +#ifdef ENABLE_ALUGRID
>  #include <dune/grid/alugrid.hh>
>  #endif
>  
> @@ -25,29 +25,35 @@
>  
>  int main() try {
>  
> +    const std::string path("../../../../../doc/grids/gmsh/");
> +    std::string curved2d( path );
> +    curved2d += "curved2d.msh";
> +    std::string pyramid( path );
> +    pyramid += "pyramid.msh";
> +
>      // Test whether unstructured grids can be read and written
> -#ifdef HAVE_UG
> +#ifdef ENABLE_UG
>      std::cout << "reading UGGrid<2>" << std::endl;
> -    testReadingGrid<UGGrid<2> >("../../../../doc/grids/gmsh/curved2d.msh");
> +    testReadingGrid<UGGrid<2> >( curved2d );
>  
>      std::cout << "reading UGGrid<3>" << std::endl;
> -    testReadingGrid<UGGrid<3> >("../../../../doc/grids/gmsh/pyramid.msh");
> +    testReadingGrid<UGGrid<3> >( pyramid );
>  #endif
>  
> -#ifdef HAVE_ALBERTA
> +#ifdef ENABLE_ALBERTA
>      std::cout << "reading AlbertaGrid<2>" << std::endl;
> -    testReadingGrid<AlbertaGrid<2> >("../../../../doc/grids/gmsh/curved2d.msh");
> +    testReadingGrid<AlbertaGrid<2> >( curved2d );
>  
>      std::cout << "reading AlbertaGrid<3>" << std::endl;
> -    testReadingGrid<AlbertaGrid<3> >("../../../../doc/grids/gmsh/pyramid.msh");
> +    testReadingGrid<AlbertaGrid<3> >( pyramid );
>  #endif
>  
> -#ifdef HAVE_ALUGRID
> +#ifdef ENABLE_ALUGRID
>  //     std::cout << "reading ALUSimplexGrid<2,2>" << std::endl;
> -//     testReadingGrid<ALUSimplexGrid<2,2> >("../../../../doc/grids/gmsh/curved2d.msh");
> +//     testReadingGrid<ALUSimplexGrid<2,2> >( cruved2d );
>  
>      std::cout << "reading ALUSimplexGrid<3,3>" << std::endl;
> -    testReadingGrid<ALUSimplexGrid<3,3> >("../../../../doc/grids/gmsh/pyramid.msh");
> +    testReadingGrid<ALUSimplexGrid<3,3> >( pyramid );
>  #endif
>  
>      return 0;
> 
> 
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
> 




More information about the Dune mailing list