Skip to content
Snippets Groups Projects
Commit f59f8d50 authored by Martin Bauer's avatar Martin Bauer
Browse files

Bugfix in Python test

- nesting check macros in iteration macros not working
parent 57281b6a
No related merge requests found
...@@ -29,18 +29,17 @@ ...@@ -29,18 +29,17 @@
#include "blockforest/Initialization.h" #include "blockforest/Initialization.h"
#include "blockforest/python/Exports.h" #include "blockforest/python/Exports.h"
#include "field/python/Exports.h" #include "field/python/Exports.h"
#include "field/iterators/IteratorMacros.h"
#include "python_coupling/Manager.h" #include "python_coupling/Manager.h"
#include "python_coupling/PythonCallback.h" #include "python_coupling/PythonCallback.h"
#include "python_coupling/DictWrapper.h" #include "python_coupling/DictWrapper.h"
#include "stencil/D2Q9.h" #include "stencil/D2Q9.h"
#include <boost/mpl/vector.hpp> #include <boost/mpl/vector.hpp>
using namespace walberla; using namespace walberla;
int main( int argc, char ** argv ) int main( int argc, char ** argv )
{ {
debug::enterTestMode(); debug::enterTestMode();
...@@ -86,6 +85,7 @@ int main( int argc, char ** argv ) ...@@ -86,6 +85,7 @@ int main( int argc, char ** argv )
cb.data().exposeValue("blocks", blocks); cb.data().exposeValue("blocks", blocks);
cb(); cb();
// check for equivalence // check for equivalence
for( auto blockIt = blocks->begin(); blockIt != blocks->end(); ++blockIt ) for( auto blockIt = blocks->begin(); blockIt != blocks->end(); ++blockIt )
{ {
...@@ -95,20 +95,24 @@ int main( int argc, char ** argv ) ...@@ -95,20 +95,24 @@ int main( int argc, char ** argv )
auto vec3Field = blockIt->getData<GhostLayerField<Vector3<int>,1 > >( vec3FieldID ); auto vec3Field = blockIt->getData<GhostLayerField<Vector3<int>,1 > >( vec3FieldID );
{ {
WALBERLA_FOR_ALL_CELLS(scaIt, sca2Field, vecIt, vec2Field, for(cell_idx_t z = 0; z < cell_idx_c(sca2Field->zSize()); ++z)
WALBERLA_ASSERT_EQUAL(scaIt[0], (*vecIt)[0]); for(cell_idx_t y = 0; y < cell_idx_c(sca2Field->zSize()); ++y)
WALBERLA_ASSERT_EQUAL(scaIt[1], (*vecIt)[1]); for(cell_idx_t x = 0; x < cell_idx_c(sca2Field->zSize()); ++x)
) {
} WALBERLA_CHECK_EQUAL( sca2Field->get(x,y,z, 0), vec2Field->get(x,y,z)[0] );
WALBERLA_CHECK_EQUAL( sca2Field->get(x,y,z, 1), vec2Field->get(x,y,z)[1] );
{ }
WALBERLA_FOR_ALL_CELLS(scaIt, sca3Field, vecIt, vec3Field, for(cell_idx_t z = 0; z < cell_idx_c(sca3Field->zSize()); ++z)
WALBERLA_ASSERT_EQUAL(scaIt[0], (*vecIt)[0]); for(cell_idx_t y = 0; y < cell_idx_c(sca3Field->zSize()); ++y)
WALBERLA_ASSERT_EQUAL(scaIt[1], (*vecIt)[1]); for(cell_idx_t x = 0; x < cell_idx_c(sca3Field->zSize()); ++x)
WALBERLA_ASSERT_EQUAL(scaIt[2], (*vecIt)[2]); {
) WALBERLA_CHECK_EQUAL( sca3Field->get(x,y,z, 0), vec3Field->get(x,y,z)[0] );
WALBERLA_CHECK_EQUAL( sca3Field->get(x,y,z, 1), vec3Field->get(x,y,z)[1] );
WALBERLA_CHECK_EQUAL( sca3Field->get(x,y,z, 2), vec3Field->get(x,y,z)[2] );
}
} }
} }
return 0; return 0;
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment