From 311d8154bd3d267926129fea5868e5d5107b6700 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 25 Jun 2014 14:06:03 -0700 Subject: [PATCH] added bestFit support for testing add --- tests/octree/src/ModelTests.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/octree/src/ModelTests.cpp b/tests/octree/src/ModelTests.cpp index a223e229fd..dcdb6197d0 100644 --- a/tests/octree/src/ModelTests.cpp +++ b/tests/octree/src/ModelTests.cpp @@ -26,7 +26,7 @@ void ModelTests::modelTreeTests(bool verbose) { - bool extraVerbose = true; + bool extraVerbose = false; int testsTaken = 0; int testsPassed = 0; int testsFailed = 0; @@ -292,6 +292,8 @@ void ModelTests::modelTreeTests(bool verbose) { ModelTreeElement* containingElement = tree.getContainingElement(modelID); AACube elementCube = containingElement ? containingElement->getAACube() : AACube(); + bool elementIsBestFit = containingElement->bestFitModelBounds(*foundModelByID); + if (extraVerbose) { qDebug() << "foundModelByRadius=" << foundModelByRadius; qDebug() << "foundModelByID=" << foundModelByID; @@ -303,6 +305,7 @@ void ModelTests::modelTreeTests(bool verbose) { << elementCube.getScale() * TREE_SCALE; qDebug() << "elementCube.getScale()=" << elementCube.getScale(); //containingElement->printDebugDetails("containingElement"); + qDebug() << "elementIsBestFit=" << elementIsBestFit; } // Every 1000th test, show the size of the tree... @@ -310,13 +313,14 @@ void ModelTests::modelTreeTests(bool verbose) { qDebug() << "after test:" << i << "getOctreeElementsCount()=" << tree.getOctreeElementsCount(); } - bool passed = foundModelByRadius && foundModelByID && (foundModelByRadius == foundModelByID); + bool passed = foundModelByRadius && foundModelByID && (foundModelByRadius == foundModelByID) && elementIsBestFit; if (passed) { iterationsPassed++; } else { qDebug() << "FAILED - Test" << testsTaken <<":" << qPrintable(testName) << "iteration:" << i << "foundModelByRadius=" << foundModelByRadius << "foundModelByID=" << foundModelByID - << "x/y/z=" << randomX << "," << randomY << "," << randomZ; + << "x/y/z=" << randomX << "," << randomY << "," << randomZ + << "elementIsBestFit=" << elementIsBestFit; } }