Commit d1e9111a authored by berenger-bramas's avatar berenger-bramas

Add a test.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@263 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 66df1f52
...@@ -122,6 +122,8 @@ int main(int argc, char ** argv){ ...@@ -122,6 +122,8 @@ int main(int argc, char ** argv){
counter.tic(); counter.tic();
{ // Check that each particle has been put into the right leaf { // Check that each particle has been put into the right leaf
long counterPart = 0;
typename OctreeClass::Iterator octreeIterator(&tree); typename OctreeClass::Iterator octreeIterator(&tree);
octreeIterator.gotoBottomLeft(); octreeIterator.gotoBottomLeft();
do{ do{
...@@ -138,11 +140,15 @@ int main(int argc, char ** argv){ ...@@ -138,11 +140,15 @@ int main(int argc, char ** argv){
iter.gotoNext(); iter.gotoNext();
} }
counterPart += octreeIterator.getCurrentListTargets()->getSize();
if(octreeIterator.getCurrentListTargets()->getSize() == 0){ if(octreeIterator.getCurrentListTargets()->getSize() == 0){
std::cout << "Problem, leaf is empty at index " << leafIndex << std::endl; std::cout << "Problem, leaf is empty at index " << leafIndex << std::endl;
} }
} while(octreeIterator.moveRight()); } while(octreeIterator.moveRight());
if( counterPart != NbPart ){
std::cout <<"Wrong particles number, should be " << NbPart << " but is " << counterPart << std::endl;
}
} }
{ // Check that each particle has been summed with all other { // Check that each particle has been summed with all other
......
Markdown is supported
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