Browse Source

MeshTools: this test didn't test the NaNs at all.

I wonder what was I doing back then.
pull/371/head
Vladimír Vondruš 6 years ago
parent
commit
db502c1acf
  1. 17
      src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp

17
src/Magnum/MeshTools/Test/GenerateNormalsTest.cpp

@ -362,20 +362,17 @@ void GenerateNormalsTest::smoothNanPosition() {
{ 0.0f, Constants::nan(), 0.0f}, { 0.0f, Constants::nan(), 0.0f},
}; };
/* Second triangle is just an edge, so it shouldn't contribute to the first /* Second triangle will poison a part of the first with NaNs, but it won't
triangle normal */ crash */
constexpr UnsignedInt indices[] { constexpr UnsignedInt indices[] {
0, 1, 2, 1, 2, 1 0, 1, 2, 1, 2, 3
}; };
Containers::Array<Vector3> generated = generateSmoothNormals(indices, positions); Containers::Array<Vector3> generated = generateSmoothNormals(indices, positions);
CORRADE_COMPARE_AS(generated.prefix(3), CORRADE_COMPARE(generated[0], Vector3::zAxis());
(Containers::Array<Vector3>{Containers::InPlaceInit, { CORRADE_VERIFY(Math::isNan(generated[1]).all());
Vector3::zAxis(), CORRADE_VERIFY(Math::isNan(generated[2]).all());
Vector3::zAxis(), CORRADE_VERIFY(Math::isNan(generated[3]).all());
Vector3::zAxis()
}}), TestSuite::Compare::Container<Containers::ArrayView<const Vector3>>);
CORRADE_COMPARE(Math::isNan(generated[3]), BoolVector3{0x7});
} }
void GenerateNormalsTest::smoothWrongCount() { void GenerateNormalsTest::smoothWrongCount() {

Loading…
Cancel
Save