From 56342c1f0f5163c60fe70e28bf19829e0f5c2cce Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Fri, 5 Nov 2021 07:17:03 +0100 Subject: [PATCH] Uncomment unit test in TestMathematicsFunctions.h --- test/tests/mathematics/TestMathematicsFunctions.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/tests/mathematics/TestMathematicsFunctions.h b/test/tests/mathematics/TestMathematicsFunctions.h index 7bd92432..b88ef29b 100644 --- a/test/tests/mathematics/TestMathematicsFunctions.h +++ b/test/tests/mathematics/TestMathematicsFunctions.h @@ -235,7 +235,6 @@ class TestMathematicsFunctions : public Test { clipSegmentVertices = clipSegmentWithPlanes(segmentVertices[0], segmentVertices[1], planesPoints, planesNormals, mAllocator); rp3d_test(clipSegmentVertices.size() == 0); - /* TODO : UNCOMMENT THIS // Test clipPolygonWithPlanes() Array polygonVertices(mAllocator); polygonVertices.add(Vector3(-4, 2, 0)); @@ -255,7 +254,12 @@ class TestMathematicsFunctions : public Test { polygonPlanesPoints.add(Vector3(10, 5, 0)); Array clipPolygonVertices(mAllocator); - clipPolygonWithPlanes(polygonVertices, polygonPlanesPoints, polygonPlanesNormals, clipPolygonVertices, mAllocator); + for (int i=0; i < polygonPlanesPoints.size(); i++) { + + clipPolygonVertices.clear(); + clipPolygonWithPlane(polygonVertices, polygonPlanesPoints[i], polygonPlanesNormals[i], clipPolygonVertices); + polygonVertices = clipPolygonVertices; + } rp3d_test(clipPolygonVertices.size() == 4); rp3d_test(approxEqual(clipPolygonVertices[0].x, 0, 0.000001)); rp3d_test(approxEqual(clipPolygonVertices[0].y, 2, 0.000001)); @@ -269,7 +273,6 @@ class TestMathematicsFunctions : public Test { rp3d_test(approxEqual(clipPolygonVertices[3].x, 0, 0.000001)); rp3d_test(approxEqual(clipPolygonVertices[3].y, 4, 0.000001)); rp3d_test(approxEqual(clipPolygonVertices[3].z, 0, 0.000001)); - */ // Test isPowerOfTwo() rp3d_test(!isPowerOfTwo(0));