From b8d18d01ece4c2c6cfaadd2168a4f5f6ac597527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 6 Sep 2012 21:39:37 +0200 Subject: [PATCH] Using initializer lists in Primitives tests. --- src/Primitives/Test/CapsuleTest.cpp | 180 +++++++++++++-------------- src/Primitives/Test/UVSphereTest.cpp | 72 +++++------ 2 files changed, 126 insertions(+), 126 deletions(-) diff --git a/src/Primitives/Test/CapsuleTest.cpp b/src/Primitives/Test/CapsuleTest.cpp index 983a8ed1f..45e16738f 100644 --- a/src/Primitives/Test/CapsuleTest.cpp +++ b/src/Primitives/Test/CapsuleTest.cpp @@ -39,55 +39,55 @@ void CapsuleTest::withoutTextureCoords() { Capsule capsule(2, 2, 3, 1.0f); CORRADE_COMPARE_AS(*capsule.positions(0), (vector{ - Vector4(0.0f, -1.5f, 0.0f), + {0.0f, -1.5f, 0.0f}, - Vector4(0.0f, -1.20711f, 0.707107f), - Vector4(0.612372f, -1.20711f, -0.353553f), - Vector4(-0.612373f, -1.20711f, -0.353553f), + {0.0f, -1.20711f, 0.707107f}, + {0.612372f, -1.20711f, -0.353553f}, + {-0.612373f, -1.20711f, -0.353553f}, - Vector4(0.0f, -0.5f, 1.0f), - Vector4(0.866025f, -0.5f, -0.5f), - Vector4(-0.866025f, -0.5f, -0.5f), + {0.0f, -0.5f, 1.0f}, + {0.866025f, -0.5f, -0.5f}, + {-0.866025f, -0.5f, -0.5f}, - Vector4(0.0f, 0.0f, 1.0f), - Vector4(0.866025f, 0.0f, -0.5f), - Vector4(-0.866025f, 0.0f, -0.5f), + {0.0f, 0.0f, 1.0f}, + {0.866025f, 0.0f, -0.5f}, + {-0.866025f, 0.0f, -0.5f}, - Vector4(0.0f, 0.5f, 1.0f), - Vector4(0.866025f, 0.5f, -0.5f), - Vector4(-0.866025f, 0.5f, -0.5f), + {0.0f, 0.5f, 1.0f}, + {0.866025f, 0.5f, -0.5f}, + {-0.866025f, 0.5f, -0.5f}, - Vector4(0.0f, 1.20711f, 0.707107f), - Vector4(0.612372f, 1.20711f, -0.353553f), - Vector4(-0.612372f, 1.20711f, -0.353553f), + {0.0f, 1.20711f, 0.707107f}, + {0.612372f, 1.20711f, -0.353553f}, + {-0.612372f, 1.20711f, -0.353553f}, - Vector4(0.0f, 1.5f, 0.0f) + {0.0f, 1.5f, 0.0f} }), Container); CORRADE_COMPARE_AS(*capsule.normals(0), (vector{ - Vector3(0.0f, -1.0f, 0.0f), + {0.0f, -1.0f, 0.0f}, - Vector3(0.0f, -0.707107f, 0.707107f), - Vector3(0.612372f, -0.707107f, -0.353553f), - Vector3(-0.612373f, -0.707107f, -0.353553f), + {0.0f, -0.707107f, 0.707107f}, + {0.612372f, -0.707107f, -0.353553f}, + {-0.612373f, -0.707107f, -0.353553f}, - Vector3(0.0f, 0.0f, 1.0f), - Vector3(0.866025f, 0.0f, -0.5f), - Vector3(-0.866025f, 0.0f, -0.5f), + {0.0f, 0.0f, 1.0f}, + {0.866025f, 0.0f, -0.5f}, + {-0.866025f, 0.0f, -0.5f}, - Vector3(0.0f, 0.0f, 1.0f), - Vector3(0.866025f, 0.0f, -0.5f), - Vector3(-0.866025f, 0.0f, -0.5f), + {0.0f, 0.0f, 1.0f}, + {0.866025f, 0.0f, -0.5f}, + {-0.866025f, 0.0f, -0.5f}, - Vector3(0.0f, 0.0f, 1.0f), - Vector3(0.866025f, 0.0f, -0.5f), - Vector3(-0.866025f, 0.0f, -0.5f), + {0.0f, 0.0f, 1.0f}, + {0.866025f, 0.0f, -0.5f}, + {-0.866025f, 0.0f, -0.5f}, - Vector3(0.0f, 0.707107f, 0.707107f), - Vector3(0.612372f, 0.707107f, -0.353553f), - Vector3(-0.612372f, 0.707107f, -0.353553f), + {0.0f, 0.707107f, 0.707107f}, + {0.612372f, 0.707107f, -0.353553f}, + {-0.612372f, 0.707107f, -0.353553f}, - Vector3(0.0f, 1.0f, 0.0f) + {0.0f, 1.0f, 0.0f} }), Container); CORRADE_COMPARE_AS(*capsule.indices(), (vector{ @@ -104,65 +104,65 @@ void CapsuleTest::withTextureCoords() { Capsule capsule(2, 2, 3, 1.0f, Capsule::TextureCoords::Generate); CORRADE_COMPARE_AS(*capsule.positions(0), (vector{ - Vector4(0.0f, -1.5f, 0.0f), - - Vector4(0.0f, -1.20711f, 0.707107f), - Vector4(0.612372f, -1.20711f, -0.353553f), - Vector4(-0.612373f, -1.20711f, -0.353553f), - Vector4(0.0f, -1.20711f, 0.707107f), - - Vector4(0.0f, -0.5f, 1.0f), - Vector4(0.866025f, -0.5f, -0.5f), - Vector4(-0.866025f, -0.5f, -0.5f), - Vector4(0.0f, -0.5f, 1.0f), - - Vector4(0.0f, 0.0f, 1.0f), - Vector4(0.866025f, 0.0f, -0.5f), - Vector4(-0.866025f, 0.0f, -0.5f), - Vector4(0.0f, 0.0f, 1.0f), - - Vector4(0.0f, 0.5f, 1.0f), - Vector4(0.866025f, 0.5f, -0.5f), - Vector4(-0.866025f, 0.5f, -0.5f), - Vector4(0.0f, 0.5f, 1.0f), - - Vector4(0.0f, 1.20711f, 0.707107f), - Vector4(0.612372f, 1.20711f, -0.353553f), - Vector4(-0.612372f, 1.20711f, -0.353553f), - Vector4(0.0f, 1.20711f, 0.707107f), - - Vector4(0.0f, 1.5f, 0.0f) + {0.0f, -1.5f, 0.0f}, + + {0.0f, -1.20711f, 0.707107f}, + {0.612372f, -1.20711f, -0.353553f}, + {-0.612373f, -1.20711f, -0.353553f}, + {0.0f, -1.20711f, 0.707107f}, + + {0.0f, -0.5f, 1.0f}, + {0.866025f, -0.5f, -0.5f}, + {-0.866025f, -0.5f, -0.5f}, + {0.0f, -0.5f, 1.0f}, + + {0.0f, 0.0f, 1.0f}, + {0.866025f, 0.0f, -0.5f}, + {-0.866025f, 0.0f, -0.5f}, + {0.0f, 0.0f, 1.0f}, + + {0.0f, 0.5f, 1.0f}, + {0.866025f, 0.5f, -0.5f}, + {-0.866025f, 0.5f, -0.5f}, + {0.0f, 0.5f, 1.0f}, + + {0.0f, 1.20711f, 0.707107f}, + {0.612372f, 1.20711f, -0.353553f}, + {-0.612372f, 1.20711f, -0.353553f}, + {0.0f, 1.20711f, 0.707107f}, + + {0.0f, 1.5f, 0.0f} }), Container); CORRADE_COMPARE_AS(*capsule.textureCoords2D(0), (vector{ - Vector2(0.5f, 0.0f), - - Vector2(0.0f, 0.166667f), - Vector2(0.333333f, 0.166667f), - Vector2(0.666667f, 0.166667f), - Vector2(1.0f, 0.166667f), - - Vector2(0.0f, 0.333333f), - Vector2(0.333333f, 0.333333f), - Vector2(0.666667f, 0.333333f), - Vector2(1.0f, 0.333333f), - - Vector2(0.0f, 0.5f), - Vector2(0.333333f, 0.5f), - Vector2(0.666667f, 0.5f), - Vector2(1.0f, 0.5f), - - Vector2(0.0f, 0.666667f), - Vector2(0.333333f, 0.666667f), - Vector2(0.666667f, 0.666667f), - Vector2(1.0f, 0.666667f), - - Vector2(0.0f, 0.833333f), - Vector2(0.333333f, 0.833333f), - Vector2(0.666667f, 0.833333f), - Vector2(1.0f, 0.833333f), - - Vector2(0.5f, 1.0f) + {0.5f, 0.0f}, + + {0.0f, 0.166667f}, + {0.333333f, 0.166667f}, + {0.666667f, 0.166667f}, + {1.0f, 0.166667f}, + + {0.0f, 0.333333f}, + {0.333333f, 0.333333f}, + {0.666667f, 0.333333f}, + {1.0f, 0.333333f}, + + {0.0f, 0.5f}, + {0.333333f, 0.5f}, + {0.666667f, 0.5f}, + {1.0f, 0.5f}, + + {0.0f, 0.666667f}, + {0.333333f, 0.666667f}, + {0.666667f, 0.666667f}, + {1.0f, 0.666667f}, + + {0.0f, 0.833333f}, + {0.333333f, 0.833333f}, + {0.666667f, 0.833333f}, + {1.0f, 0.833333f}, + + {0.5f, 1.0f} }), Container); CORRADE_COMPARE_AS(*capsule.indices(), (vector{ diff --git a/src/Primitives/Test/UVSphereTest.cpp b/src/Primitives/Test/UVSphereTest.cpp index 3ffd66937..269c52419 100644 --- a/src/Primitives/Test/UVSphereTest.cpp +++ b/src/Primitives/Test/UVSphereTest.cpp @@ -36,31 +36,31 @@ void UVSphereTest::withoutTextureCoords() { UVSphere sphere(3, 3); CORRADE_COMPARE_AS(*sphere.positions(0), (vector{ - Vector4(0.0f, -1.0f, 0.0f), + {0.0f, -1.0f, 0.0f}, - Vector4(0.0f, -0.5f, 0.866025f), - Vector4(0.75f, -0.5f, -0.433013f), - Vector4(-0.75f, -0.5f, -0.433013f), + {0.0f, -0.5f, 0.866025f}, + {0.75f, -0.5f, -0.433013f}, + {-0.75f, -0.5f, -0.433013f}, - Vector4(0, 0.5f, 0.866025f), - Vector4(0.75f, 0.5f, -0.433013f), - Vector4(-0.75f, 0.5f, -0.433013f), + {0, 0.5f, 0.866025f}, + {0.75f, 0.5f, -0.433013f}, + {-0.75f, 0.5f, -0.433013f}, - Vector4(0.0f, 1.0f, 0.0f) + {0.0f, 1.0f, 0.0f} }), Container); CORRADE_COMPARE_AS(*sphere.normals(0), (vector{ - Vector3(0.0f, -1.0f, 0.0f), + {0.0f, -1.0f, 0.0f}, - Vector3(0.0f, -0.5f, 0.866025f), - Vector3(0.75f, -0.5f, -0.433013f), - Vector3(-0.75f, -0.5f, -0.433013f), + {0.0f, -0.5f, 0.866025f}, + {0.75f, -0.5f, -0.433013f}, + {-0.75f, -0.5f, -0.433013f}, - Vector3(0, 0.5f, 0.866025f), - Vector3(0.75f, 0.5f, -0.433013f), - Vector3(-0.75f, 0.5f, -0.433013f), + {0, 0.5f, 0.866025f}, + {0.75f, 0.5f, -0.433013f}, + {-0.75f, 0.5f, -0.433013f}, - Vector3(0.0f, 1.0f, 0.0f) + {0.0f, 1.0f, 0.0f} }), Container); CORRADE_COMPARE_AS(*sphere.indices(), (vector{ @@ -74,35 +74,35 @@ void UVSphereTest::withTextureCoords() { UVSphere sphere(3, 3, UVSphere::TextureCoords::Generate); CORRADE_COMPARE_AS(*sphere.positions(0), (vector{ - Vector4(0.0f, -1.0f, 0.0f), + {0.0f, -1.0f, 0.0f}, - Vector4(0.0f, -0.5f, 0.866025f), - Vector4(0.75f, -0.5f, -0.433013f), - Vector4(-0.75f, -0.5f, -0.433013f), - Vector4(0.0f, -0.5f, 0.866025f), + {0.0f, -0.5f, 0.866025f}, + {0.75f, -0.5f, -0.433013f}, + {-0.75f, -0.5f, -0.433013f}, + {0.0f, -0.5f, 0.866025f}, - Vector4(0.0f, 0.5f, 0.866025f), - Vector4(0.75f, 0.5f, -0.433013f), - Vector4(-0.75f, 0.5f, -0.433013f), - Vector4(0.0f, 0.5f, 0.866025f), + {0.0f, 0.5f, 0.866025f}, + {0.75f, 0.5f, -0.433013f}, + {-0.75f, 0.5f, -0.433013f}, + {0.0f, 0.5f, 0.866025f}, - Vector4(0.0f, 1.0f, 0.0f) + {0.0f, 1.0f, 0.0f} }), Container); CORRADE_COMPARE_AS(*sphere.textureCoords2D(0), (vector{ - Vector2(0.5f, 0.0f), + {0.5f, 0.0f}, - Vector2(0.0f, 0.333333f), - Vector2(0.333333f, 0.333333f), - Vector2(0.666667f, 0.333333f), - Vector2(1.0f, 0.333333f), + {0.0f, 0.333333f}, + {0.333333f, 0.333333f}, + {0.666667f, 0.333333f}, + {1.0f, 0.333333f}, - Vector2(0.0f, 0.666667f), - Vector2(0.333333f, 0.666667f), - Vector2(0.666667f, 0.666667f), - Vector2(1.0f, 0.666667f), + {0.0f, 0.666667f}, + {0.333333f, 0.666667f}, + {0.666667f, 0.666667f}, + {1.0f, 0.666667f}, - Vector2(0.5f, 1.0f) + {0.5f, 1.0f} }), Container); CORRADE_COMPARE_AS(*sphere.indices(), (vector{