Browse Source

Using initializer lists in Primitives tests.

pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
b8d18d01ec
  1. 180
      src/Primitives/Test/CapsuleTest.cpp
  2. 72
      src/Primitives/Test/UVSphereTest.cpp

180
src/Primitives/Test/CapsuleTest.cpp

@ -39,55 +39,55 @@ void CapsuleTest::withoutTextureCoords() {
Capsule capsule(2, 2, 3, 1.0f); Capsule capsule(2, 2, 3, 1.0f);
CORRADE_COMPARE_AS(*capsule.positions(0), (vector<Vector4>{ CORRADE_COMPARE_AS(*capsule.positions(0), (vector<Vector4>{
Vector4(0.0f, -1.5f, 0.0f), {0.0f, -1.5f, 0.0f},
Vector4(0.0f, -1.20711f, 0.707107f), {0.0f, -1.20711f, 0.707107f},
Vector4(0.612372f, -1.20711f, -0.353553f), {0.612372f, -1.20711f, -0.353553f},
Vector4(-0.612373f, -1.20711f, -0.353553f), {-0.612373f, -1.20711f, -0.353553f},
Vector4(0.0f, -0.5f, 1.0f), {0.0f, -0.5f, 1.0f},
Vector4(0.866025f, -0.5f, -0.5f), {0.866025f, -0.5f, -0.5f},
Vector4(-0.866025f, -0.5f, -0.5f), {-0.866025f, -0.5f, -0.5f},
Vector4(0.0f, 0.0f, 1.0f), {0.0f, 0.0f, 1.0f},
Vector4(0.866025f, 0.0f, -0.5f), {0.866025f, 0.0f, -0.5f},
Vector4(-0.866025f, 0.0f, -0.5f), {-0.866025f, 0.0f, -0.5f},
Vector4(0.0f, 0.5f, 1.0f), {0.0f, 0.5f, 1.0f},
Vector4(0.866025f, 0.5f, -0.5f), {0.866025f, 0.5f, -0.5f},
Vector4(-0.866025f, 0.5f, -0.5f), {-0.866025f, 0.5f, -0.5f},
Vector4(0.0f, 1.20711f, 0.707107f), {0.0f, 1.20711f, 0.707107f},
Vector4(0.612372f, 1.20711f, -0.353553f), {0.612372f, 1.20711f, -0.353553f},
Vector4(-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); }), Container);
CORRADE_COMPARE_AS(*capsule.normals(0), (vector<Vector3>{ CORRADE_COMPARE_AS(*capsule.normals(0), (vector<Vector3>{
Vector3(0.0f, -1.0f, 0.0f), {0.0f, -1.0f, 0.0f},
Vector3(0.0f, -0.707107f, 0.707107f), {0.0f, -0.707107f, 0.707107f},
Vector3(0.612372f, -0.707107f, -0.353553f), {0.612372f, -0.707107f, -0.353553f},
Vector3(-0.612373f, -0.707107f, -0.353553f), {-0.612373f, -0.707107f, -0.353553f},
Vector3(0.0f, 0.0f, 1.0f), {0.0f, 0.0f, 1.0f},
Vector3(0.866025f, 0.0f, -0.5f), {0.866025f, 0.0f, -0.5f},
Vector3(-0.866025f, 0.0f, -0.5f), {-0.866025f, 0.0f, -0.5f},
Vector3(0.0f, 0.0f, 1.0f), {0.0f, 0.0f, 1.0f},
Vector3(0.866025f, 0.0f, -0.5f), {0.866025f, 0.0f, -0.5f},
Vector3(-0.866025f, 0.0f, -0.5f), {-0.866025f, 0.0f, -0.5f},
Vector3(0.0f, 0.0f, 1.0f), {0.0f, 0.0f, 1.0f},
Vector3(0.866025f, 0.0f, -0.5f), {0.866025f, 0.0f, -0.5f},
Vector3(-0.866025f, 0.0f, -0.5f), {-0.866025f, 0.0f, -0.5f},
Vector3(0.0f, 0.707107f, 0.707107f), {0.0f, 0.707107f, 0.707107f},
Vector3(0.612372f, 0.707107f, -0.353553f), {0.612372f, 0.707107f, -0.353553f},
Vector3(-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); }), Container);
CORRADE_COMPARE_AS(*capsule.indices(), (vector<unsigned int>{ CORRADE_COMPARE_AS(*capsule.indices(), (vector<unsigned int>{
@ -104,65 +104,65 @@ void CapsuleTest::withTextureCoords() {
Capsule capsule(2, 2, 3, 1.0f, Capsule::TextureCoords::Generate); Capsule capsule(2, 2, 3, 1.0f, Capsule::TextureCoords::Generate);
CORRADE_COMPARE_AS(*capsule.positions(0), (vector<Vector4>{ CORRADE_COMPARE_AS(*capsule.positions(0), (vector<Vector4>{
Vector4(0.0f, -1.5f, 0.0f), {0.0f, -1.5f, 0.0f},
Vector4(0.0f, -1.20711f, 0.707107f), {0.0f, -1.20711f, 0.707107f},
Vector4(0.612372f, -1.20711f, -0.353553f), {0.612372f, -1.20711f, -0.353553f},
Vector4(-0.612373f, -1.20711f, -0.353553f), {-0.612373f, -1.20711f, -0.353553f},
Vector4(0.0f, -1.20711f, 0.707107f), {0.0f, -1.20711f, 0.707107f},
Vector4(0.0f, -0.5f, 1.0f), {0.0f, -0.5f, 1.0f},
Vector4(0.866025f, -0.5f, -0.5f), {0.866025f, -0.5f, -0.5f},
Vector4(-0.866025f, -0.5f, -0.5f), {-0.866025f, -0.5f, -0.5f},
Vector4(0.0f, -0.5f, 1.0f), {0.0f, -0.5f, 1.0f},
Vector4(0.0f, 0.0f, 1.0f), {0.0f, 0.0f, 1.0f},
Vector4(0.866025f, 0.0f, -0.5f), {0.866025f, 0.0f, -0.5f},
Vector4(-0.866025f, 0.0f, -0.5f), {-0.866025f, 0.0f, -0.5f},
Vector4(0.0f, 0.0f, 1.0f), {0.0f, 0.0f, 1.0f},
Vector4(0.0f, 0.5f, 1.0f), {0.0f, 0.5f, 1.0f},
Vector4(0.866025f, 0.5f, -0.5f), {0.866025f, 0.5f, -0.5f},
Vector4(-0.866025f, 0.5f, -0.5f), {-0.866025f, 0.5f, -0.5f},
Vector4(0.0f, 0.5f, 1.0f), {0.0f, 0.5f, 1.0f},
Vector4(0.0f, 1.20711f, 0.707107f), {0.0f, 1.20711f, 0.707107f},
Vector4(0.612372f, 1.20711f, -0.353553f), {0.612372f, 1.20711f, -0.353553f},
Vector4(-0.612372f, 1.20711f, -0.353553f), {-0.612372f, 1.20711f, -0.353553f},
Vector4(0.0f, 1.20711f, 0.707107f), {0.0f, 1.20711f, 0.707107f},
Vector4(0.0f, 1.5f, 0.0f) {0.0f, 1.5f, 0.0f}
}), Container); }), Container);
CORRADE_COMPARE_AS(*capsule.textureCoords2D(0), (vector<Vector2>{ CORRADE_COMPARE_AS(*capsule.textureCoords2D(0), (vector<Vector2>{
Vector2(0.5f, 0.0f), {0.5f, 0.0f},
Vector2(0.0f, 0.166667f), {0.0f, 0.166667f},
Vector2(0.333333f, 0.166667f), {0.333333f, 0.166667f},
Vector2(0.666667f, 0.166667f), {0.666667f, 0.166667f},
Vector2(1.0f, 0.166667f), {1.0f, 0.166667f},
Vector2(0.0f, 0.333333f), {0.0f, 0.333333f},
Vector2(0.333333f, 0.333333f), {0.333333f, 0.333333f},
Vector2(0.666667f, 0.333333f), {0.666667f, 0.333333f},
Vector2(1.0f, 0.333333f), {1.0f, 0.333333f},
Vector2(0.0f, 0.5f), {0.0f, 0.5f},
Vector2(0.333333f, 0.5f), {0.333333f, 0.5f},
Vector2(0.666667f, 0.5f), {0.666667f, 0.5f},
Vector2(1.0f, 0.5f), {1.0f, 0.5f},
Vector2(0.0f, 0.666667f), {0.0f, 0.666667f},
Vector2(0.333333f, 0.666667f), {0.333333f, 0.666667f},
Vector2(0.666667f, 0.666667f), {0.666667f, 0.666667f},
Vector2(1.0f, 0.666667f), {1.0f, 0.666667f},
Vector2(0.0f, 0.833333f), {0.0f, 0.833333f},
Vector2(0.333333f, 0.833333f), {0.333333f, 0.833333f},
Vector2(0.666667f, 0.833333f), {0.666667f, 0.833333f},
Vector2(1.0f, 0.833333f), {1.0f, 0.833333f},
Vector2(0.5f, 1.0f) {0.5f, 1.0f}
}), Container); }), Container);
CORRADE_COMPARE_AS(*capsule.indices(), (vector<unsigned int>{ CORRADE_COMPARE_AS(*capsule.indices(), (vector<unsigned int>{

72
src/Primitives/Test/UVSphereTest.cpp

@ -36,31 +36,31 @@ void UVSphereTest::withoutTextureCoords() {
UVSphere sphere(3, 3); UVSphere sphere(3, 3);
CORRADE_COMPARE_AS(*sphere.positions(0), (vector<Vector4>{ CORRADE_COMPARE_AS(*sphere.positions(0), (vector<Vector4>{
Vector4(0.0f, -1.0f, 0.0f), {0.0f, -1.0f, 0.0f},
Vector4(0.0f, -0.5f, 0.866025f), {0.0f, -0.5f, 0.866025f},
Vector4(0.75f, -0.5f, -0.433013f), {0.75f, -0.5f, -0.433013f},
Vector4(-0.75f, -0.5f, -0.433013f), {-0.75f, -0.5f, -0.433013f},
Vector4(0, 0.5f, 0.866025f), {0, 0.5f, 0.866025f},
Vector4(0.75f, 0.5f, -0.433013f), {0.75f, 0.5f, -0.433013f},
Vector4(-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); }), Container);
CORRADE_COMPARE_AS(*sphere.normals(0), (vector<Vector3>{ CORRADE_COMPARE_AS(*sphere.normals(0), (vector<Vector3>{
Vector3(0.0f, -1.0f, 0.0f), {0.0f, -1.0f, 0.0f},
Vector3(0.0f, -0.5f, 0.866025f), {0.0f, -0.5f, 0.866025f},
Vector3(0.75f, -0.5f, -0.433013f), {0.75f, -0.5f, -0.433013f},
Vector3(-0.75f, -0.5f, -0.433013f), {-0.75f, -0.5f, -0.433013f},
Vector3(0, 0.5f, 0.866025f), {0, 0.5f, 0.866025f},
Vector3(0.75f, 0.5f, -0.433013f), {0.75f, 0.5f, -0.433013f},
Vector3(-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); }), Container);
CORRADE_COMPARE_AS(*sphere.indices(), (vector<unsigned int>{ CORRADE_COMPARE_AS(*sphere.indices(), (vector<unsigned int>{
@ -74,35 +74,35 @@ void UVSphereTest::withTextureCoords() {
UVSphere sphere(3, 3, UVSphere::TextureCoords::Generate); UVSphere sphere(3, 3, UVSphere::TextureCoords::Generate);
CORRADE_COMPARE_AS(*sphere.positions(0), (vector<Vector4>{ CORRADE_COMPARE_AS(*sphere.positions(0), (vector<Vector4>{
Vector4(0.0f, -1.0f, 0.0f), {0.0f, -1.0f, 0.0f},
Vector4(0.0f, -0.5f, 0.866025f), {0.0f, -0.5f, 0.866025f},
Vector4(0.75f, -0.5f, -0.433013f), {0.75f, -0.5f, -0.433013f},
Vector4(-0.75f, -0.5f, -0.433013f), {-0.75f, -0.5f, -0.433013f},
Vector4(0.0f, -0.5f, 0.866025f), {0.0f, -0.5f, 0.866025f},
Vector4(0.0f, 0.5f, 0.866025f), {0.0f, 0.5f, 0.866025f},
Vector4(0.75f, 0.5f, -0.433013f), {0.75f, 0.5f, -0.433013f},
Vector4(-0.75f, 0.5f, -0.433013f), {-0.75f, 0.5f, -0.433013f},
Vector4(0.0f, 0.5f, 0.866025f), {0.0f, 0.5f, 0.866025f},
Vector4(0.0f, 1.0f, 0.0f) {0.0f, 1.0f, 0.0f}
}), Container); }), Container);
CORRADE_COMPARE_AS(*sphere.textureCoords2D(0), (vector<Vector2>{ CORRADE_COMPARE_AS(*sphere.textureCoords2D(0), (vector<Vector2>{
Vector2(0.5f, 0.0f), {0.5f, 0.0f},
Vector2(0.0f, 0.333333f), {0.0f, 0.333333f},
Vector2(0.333333f, 0.333333f), {0.333333f, 0.333333f},
Vector2(0.666667f, 0.333333f), {0.666667f, 0.333333f},
Vector2(1.0f, 0.333333f), {1.0f, 0.333333f},
Vector2(0.0f, 0.666667f), {0.0f, 0.666667f},
Vector2(0.333333f, 0.666667f), {0.333333f, 0.666667f},
Vector2(0.666667f, 0.666667f), {0.666667f, 0.666667f},
Vector2(1.0f, 0.666667f), {1.0f, 0.666667f},
Vector2(0.5f, 1.0f) {0.5f, 1.0f}
}), Container); }), Container);
CORRADE_COMPARE_AS(*sphere.indices(), (vector<unsigned int>{ CORRADE_COMPARE_AS(*sphere.indices(), (vector<unsigned int>{

Loading…
Cancel
Save