From 30fa9645c1515ea7c712ed82b7c7b26e48b4514a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 24 Mar 2017 00:00:59 +0100 Subject: [PATCH] Primitives: fix Cylinder test to follow the bugfix. Also added a bunch of comments to prevent confusing myself again next time and spaced the indices evenly to make them readable. All those poorly done things contributed to the bug. --- src/Magnum/Primitives/Test/CylinderTest.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Primitives/Test/CylinderTest.cpp b/src/Magnum/Primitives/Test/CylinderTest.cpp index 7c2802742..905a74415 100644 --- a/src/Magnum/Primitives/Test/CylinderTest.cpp +++ b/src/Magnum/Primitives/Test/CylinderTest.cpp @@ -86,6 +86,7 @@ void CylinderTest::solidWithoutAnything() { void CylinderTest::solidWithTextureCoordsAndCaps() { Trade::MeshData3D cylinder = Cylinder::solid(2, 3, 1.5f, Cylinder::Flag::GenerateTextureCoords|Cylinder::Flag::CapEnds); + /* First and last ring are duplicated because they have different normals */ CORRADE_COMPARE_AS(cylinder.positions(0), (std::vector{ {0.0f, -1.5f, 0.0f}, @@ -179,11 +180,13 @@ void CylinderTest::solidWithTextureCoordsAndCaps() { {0.5f, 1.0f} }), TestSuite::Compare::Container); + /* Faces of the caps and sides do not share any vertices due to different + normals */ CORRADE_COMPARE_AS(cylinder.indices(), (std::vector{ - 0, 2, 1, 0, 3, 2, 0, 4, 3, - 1, 2, 6, 1, 6, 5, 2, 3, 7, 2, 7, 6, 3, 4, 8, 3, 8, 7, - 5, 6, 10, 5, 10, 9, 6, 7, 11, 6, 11, 10, 7, 8, 12, 7, - 12, 11, 17, 18, 21, 18, 19, 21, 19, 20, 21 + 0, 2, 1, 0, 3, 2, 0, 4, 3, + 4, 5, 9, 4, 9, 8, 5, 6, 10, 5, 10, 9, 6, 7, 11, 6, 11, 10, + 8, 9, 13, 8, 13, 12, 9, 10, 14, 9, 14, 13, 10, 11, 15, 10, 15, 14, + 17, 18, 21, 18, 19, 21, 19, 20, 21 }), TestSuite::Compare::Container); }