Commit 3c2edc85 authored by berenger-bramas's avatar berenger-bramas

Change the unit test that compares a previous result (from my computer)

with a simulation on the user computer.
The comparaison is made with fmath::lookequal

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@447 2616d619-271b-44dc-8df4-d4a8f33a7222
parent a69a4c54
......@@ -101,7 +101,10 @@ class TestSphericalWithPrevious : public FUTester<TestSphericalWithPrevious> {
typename ContainerClass::BasicIterator testIter(*testOctreeIterator.getCurrentListTargets());
while( goodIter.hasNotFinished() ){
assert( memcmp(&goodIter.data(), &testIter.data(), sizeof(ParticleClass)) == 0);
assert( FMath::LookEqual(goodIter.data().getPotential(), testIter.data().getPotential()) );
assert( FMath::LookEqual(goodIter.data().getPosition().getX(), testIter.data().getPosition().getX()) );
assert( FMath::LookEqual(goodIter.data().getPosition().getY(), testIter.data().getPosition().getY()) );
assert( FMath::LookEqual(goodIter.data().getPosition().getZ(), testIter.data().getPosition().getZ()) );
goodIter.gotoNext();
testIter.gotoNext();
......@@ -136,11 +139,19 @@ class TestSphericalWithPrevious : public FUTester<TestSphericalWithPrevious> {
break;
}
assert( memcmp(testOctreeIterator.getCurrentCell()->getLocal(),
goodOctreeIterator.getCurrentCell()->getLocal(), CellClass::GetLocalSize() * sizeof(FComplexe)) == 0);
for(int idxLocal = 0 ; idxLocal < CellClass::GetLocalSize() ; ++idxLocal){
FMath::LookEqual(testOctreeIterator.getCurrentCell()->getLocal()[idxLocal].getReal(),
goodOctreeIterator.getCurrentCell()->getLocal()[idxLocal].getReal());
FMath::LookEqual(testOctreeIterator.getCurrentCell()->getLocal()[idxLocal].getImag(),
goodOctreeIterator.getCurrentCell()->getLocal()[idxLocal].getImag());
}
assert( memcmp(testOctreeIterator.getCurrentCell()->getMultipole(),
goodOctreeIterator.getCurrentCell()->getMultipole(),CellClass::GetPoleSize() * sizeof(FComplexe)) == 0);
for(int idxPole = 0 ; idxPole < CellClass::GetPoleSize() ; ++idxPole){
FMath::LookEqual(testOctreeIterator.getCurrentCell()->getMultipole()[idxPole].getReal(),
goodOctreeIterator.getCurrentCell()->getMultipole()[idxPole].getReal());
FMath::LookEqual(testOctreeIterator.getCurrentCell()->getMultipole()[idxPole].getImag(),
goodOctreeIterator.getCurrentCell()->getMultipole()[idxPole].getImag());
}
if(!testOctreeIterator.moveRight()){
if(goodOctreeIterator.moveRight()){
......
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