[Dune] [Dune-Commit] dune-grid r8200 - trunk/dune/grid/test

Christian Engwer christian.engwer at uni-muenster.de
Thu May 31 11:46:53 CEST 2012


Hi Christoph,

I think this is the wrong way to fix the issue. THe problem is that
assert is disabled when compiling with -DNDEBUG, but what is the use
of a test if many checks are not performed? Thus I think it is
necessary to force the tests to use assert and similar...

Christian

On Thu, May 31, 2012 at 10:51:56AM +0200, gruenich at dune-project.org wrote:
> Author: gruenich
> Date: 2012-05-31 10:51:55 +0200 (Thu, 31 May 2012)
> New Revision: 8200
> 
> Modified:
>    trunk/dune/grid/test/checkgeometry.cc
>    trunk/dune/grid/test/checkindexset.cc
>    trunk/dune/grid/test/gridcheck.cc
> Log:
> Fixed some unused variable warnings with #ifndef NDEBUG.
> 
> 
> Modified: trunk/dune/grid/test/checkgeometry.cc
> ===================================================================
> --- trunk/dune/grid/test/checkgeometry.cc	2012-05-30 18:31:18 UTC (rev 8199)
> +++ trunk/dune/grid/test/checkgeometry.cc	2012-05-31 08:51:55 UTC (rev 8200)
> @@ -184,8 +184,10 @@
>      enum { dimw = GV::dimensionworld };
>  
>      const FieldVector<ctype, dim> pos(0.2);
> +    #ifndef NDEBUG
>      const FieldVector<ctype, dimw> glob =
>        gridView.template begin<0>()->geometry().global(pos);
> +    #endif
>      
>      Iterator it = gridView.template begin<0>();
>      const Geometry geomCopy = it->geometry();
> 
> Modified: trunk/dune/grid/test/checkindexset.cc
> ===================================================================
> --- trunk/dune/grid/test/checkindexset.cc	2012-05-30 18:31:18 UTC (rev 8199)
> +++ trunk/dune/grid/test/checkindexset.cc	2012-05-31 08:51:55 UTC (rev 8200)
> @@ -404,7 +404,9 @@
>    {
>      typedef typename GridView :: template Codim< 0 > :: Iterator Iterator;
>      // choose the right reference element 
> +    #ifndef NDEBUG
>      const Iterator refend = view.template end< 0 >();
> +    #endif
>      Iterator refit = view.template begin< 0 >();
>      assert( refit != refend );
>        
> 
> Modified: trunk/dune/grid/test/gridcheck.cc
> ===================================================================
> --- trunk/dune/grid/test/gridcheck.cc	2012-05-30 18:31:18 UTC (rev 8199)
> +++ trunk/dune/grid/test/gridcheck.cc	2012-05-31 08:51:55 UTC (rev 8200)
> @@ -40,11 +40,13 @@
>      {
>        typedef typename Grid::template Codim< Entity::codimension >::EntityPointer EntityPointer;
>        typedef typename Grid::template Codim< Entity::codimension >::EntitySeed EntitySeed;
> +      #ifndef NDEBUG
>        EntitySeed seed = e.seed();
>  
>        EntityPointer ep1 ( e );
>        // regain entity pointer and check equality
>        EntityPointer ep2 = g.entityPointer( seed );
> +      #endif
>        assert( ep1 == ep2 );
>      }
>  
> @@ -56,11 +58,13 @@
>        EntityPointer ep( *(e.template subEntity< cd >( i ) ) );
>        assert( ep == e.template subEntity< cd >( i ) );
>  
> +      #ifndef NDEBUG
>        typedef typename Grid::template Codim< cd >::EntitySeed EntitySeed;
>        EntitySeed seed = ep->seed();
>  
>        // regain entity pointer and check equality
>        EntityPointer ep2 = g.entityPointer( seed );
> +      #endif
>        assert( ep == ep2 );
>  
>        const typename Grid::LevelGridView &levelGridView = g.levelView(e.level());
> 
> 
> _______________________________________________
> 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