Fix test case on 32bit platform (caused by double inaccuracy)

This commit is contained in:
Sebastian Messmer 2016-04-02 10:13:28 +02:00
parent 668b826423
commit 97bd758eb8

View File

@ -179,7 +179,7 @@ TEST_P(DataTreeTest_ResizeNumBytes_P, NumBytesIsCorrect) {
TEST_P(DataTreeTest_ResizeNumBytes_P, DepthFlagsAreCorrect) {
tree->resizeNumBytes(newSize);
tree->flush();
uint32_t depth = ceil(log(newNumberOfLeaves)/log(DataTreeTest_ResizeNumBytes::LAYOUT.maxChildrenPerInnerNode()));
uint32_t depth = ceil(log(newNumberOfLeaves)/log(DataTreeTest_ResizeNumBytes::LAYOUT.maxChildrenPerInnerNode()) - 0.00000000001); // The subtraction takes care of double inaccuracies if newNumberOfLeaves == maxChildrenPerInnerNode
CHECK_DEPTH(depth, tree->key());
}