Skip to content

Commit

Permalink
refs #6447 Thorough test for all suspicious places.
Browse files Browse the repository at this point in the history
Tested the pieces of code where changes can be expected
  • Loading branch information
abuts committed Sep 24, 2013
1 parent 3e3dfd7 commit 65611fd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Code/Mantid/Framework/MDEvents/test/MDBoxFlatTreeTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@ class MDBoxFlatTreeTest :public CxxTest::TestSuite
std::vector<API::IMDNode *>Boxes;
TS_ASSERT_THROWS_NOTHING(BoxStoredTree.restoreBoxTree(Boxes ,new_bc, false,false));

std::vector<API::IMDNode *>OldBoxes;
TS_ASSERT_THROWS_NOTHING(spEw3->getBoxes(OldBoxes, 1000, false));
// just in case, should be already sorted
API::IMDNode::sortObjByID(OldBoxes);

for(size_t i=0;i<OldBoxes.size();i++)
{
TS_ASSERT(OldBoxes[i]->getID()==Boxes[i]->getID());
size_t numChildren = Boxes[i]->getNumChildren();
TS_ASSERT(OldBoxes[i]->getNumChildren()==numChildren);
if(numChildren>0)
{
TS_ASSERT(OldBoxes[i]->getChild(0)->getID()==Boxes[i]->getChild(0)->getID());
}
}


if(testFile.exists())
testFile.remove();
}
Expand Down

0 comments on commit 65611fd

Please sign in to comment.