diff --git a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp index 22d79fa25..e7aa6a92d 100644 --- a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp +++ b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp @@ -295,19 +295,19 @@ void RemoveDuplicatesTest::removeDuplicatesFuzzyInPlaceMoreDimensions() { /* Numbers with distance 1 should be merged, numbers with distance 2 should be kept. Testing both even-odd and odd-even sequence to verify that half-epsilon translations are applied properly. */ - Vector2i data[]{ - {1, 0}, - {2, 1}, - {0, 4}, - {1, 5} + Vector2 data[]{ + {1.0f, 0.0f}, + {2.0f, 1.0f}, + {0.0f, 4.0f}, + {1.0f, 5.0f} }; - std::pair, std::size_t> result = MeshTools::removeDuplicatesFuzzyInPlace(Containers::stridedArrayView(data), 2); + std::pair, std::size_t> result = MeshTools::removeDuplicatesFuzzyInPlace(Containers::stridedArrayView(data), 2.0f); CORRADE_COMPARE_AS(Containers::arrayView(result.first), Containers::arrayView({0, 0, 1, 1}), TestSuite::Compare::Container); CORRADE_COMPARE_AS(Containers::arrayView(data).prefix(result.second), - Containers::arrayView({{1, 0}, {0, 4}}), + Containers::arrayView({{1.0f, 0.0f}, {0.0f, 4.0f}}), TestSuite::Compare::Container); } @@ -329,21 +329,21 @@ void RemoveDuplicatesTest::removeDuplicatesFuzzyInPlaceIntoWrongOutputSize() { #ifdef MAGNUM_BUILD_DEPRECATED void RemoveDuplicatesTest::removeDuplicatesFuzzyStl() { /* Same but with implicit bloat. HEH HEH */ - std::vector data{ - {1, 0}, - {2, 1}, - {0, 4}, - {1, 5} + std::vector data{ + {1.0f, 0.0f}, + {2.0f, 1.0f}, + {0.0f, 4.0f}, + {1.0f, 5.0f} }; CORRADE_IGNORE_DEPRECATED_PUSH - const std::vector indices = MeshTools::removeDuplicates(data, 2); + const std::vector indices = MeshTools::removeDuplicates(data, 2.0f); CORRADE_IGNORE_DEPRECATED_POP CORRADE_COMPARE_AS(indices, (std::vector{0, 0, 1, 1}), TestSuite::Compare::Container); CORRADE_COMPARE_AS(data, - (std::vector{{1, 0}, {0, 4}}), + (std::vector{{1.0f, 0.0f}, {0.0f, 4.0f}}), TestSuite::Compare::Container); } #endif @@ -353,11 +353,11 @@ template void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlace /* Same as above, but with an explicit index buffer */ T indices[]{3, 2, 0, 1, 2, 3}; - Vector2i data[]{ - {1, 0}, - {2, 1}, - {0, 4}, - {1, 5} + Vector2 data[]{ + {1.0f, 0.0f}, + {2.0f, 1.0f}, + {0.0f, 4.0f}, + {1.0f, 5.0f} }; std::size_t count = MeshTools::removeDuplicatesFuzzyIndexedInPlace( @@ -367,7 +367,7 @@ template void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlace Containers::arrayView({1, 1, 0, 0, 1, 1}), TestSuite::Compare::Container); CORRADE_COMPARE_AS(Containers::arrayView(data).prefix(count), - Containers::arrayView({{1, 0}, {0, 4}}), + Containers::arrayView({{1.0f, 0.0f}, {0.0f, 4.0f}}), TestSuite::Compare::Container); } @@ -380,31 +380,31 @@ void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlaceSmallType() { Error redirectError{&out}; UnsignedByte indices[1]; - Vector2i data[256]{}; + Vector2 data[256]{}; MeshTools::removeDuplicatesFuzzyIndexedInPlace( Containers::stridedArrayView(indices), - Containers::stridedArrayView(data), 2); + Containers::stridedArrayView(data)); CORRADE_COMPARE(out.str(), "MeshTools::removeDuplicatesFuzzyIndexedInPlace(): a 1-byte index type is too small for 256 vertices\n"); } void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlaceEmptyIndices() { - Vector2i data[]{ - {1, 0}, - {2, 1}, - {0, 4}, - {1, 5} + Vector2 data[]{ + {1.0f, 0.0f}, + {2.0f, 1.0f}, + {0.0f, 4.0f}, + {1.0f, 5.0f} }; std::size_t count = MeshTools::removeDuplicatesFuzzyIndexedInPlace( Containers::StridedArrayView1D{}, - Containers::stridedArrayView(data), 2); + Containers::stridedArrayView(data), 2.0f); CORRADE_COMPARE_AS(Containers::arrayView(data).prefix(count), - Containers::arrayView({{1, 0}, {0, 4}}), + Containers::arrayView({{1.0f, 0.0f}, {0.0f, 4.0f}}), TestSuite::Compare::Container); } void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlaceEmptyIndicesVertices() { - CORRADE_COMPARE((MeshTools::removeDuplicatesFuzzyIndexedInPlace({}, {}, 2)), 0); + CORRADE_COMPARE((MeshTools::removeDuplicatesFuzzyIndexedInPlace({}, {})), 0); } template void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlaceErased() { @@ -412,11 +412,11 @@ template void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlace /* Same as above, but with an explicit index buffer */ T indices[]{3, 2, 0, 1, 2, 3}; - Vector2i data[]{ - {1, 0}, - {2, 1}, - {0, 4}, - {1, 5} + Vector2 data[]{ + {1.0f, 0.0f}, + {2.0f, 1.0f}, + {0.0f, 4.0f}, + {1.0f, 5.0f} }; std::size_t count = MeshTools::removeDuplicatesFuzzyIndexedInPlace( @@ -426,7 +426,7 @@ template void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlace Containers::arrayView({1, 1, 0, 0, 1, 1}), TestSuite::Compare::Container); CORRADE_COMPARE_AS(Containers::arrayView(data).prefix(count), - Containers::arrayView({{1, 0}, {0, 4}}), + Containers::arrayView({{1.0f, 0.0f}, {0.0f, 4.0f}}), TestSuite::Compare::Container); } @@ -436,13 +436,13 @@ void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlaceErasedNonContiguou #endif char indices[6*4]{}; - Vector2i data[1]; + Vector2 data[1]; std::stringstream out; Error redirectError{&out}; MeshTools::removeDuplicatesFuzzyIndexedInPlace( Containers::StridedArrayView2D{indices, {6, 2}, {4, 2}}, - Containers::stridedArrayView(data), 2); + Containers::stridedArrayView(data)); CORRADE_COMPARE(out.str(), "MeshTools::removeDuplicatesFuzzyIndexedInPlace(): second index view dimension is not contiguous\n"); } @@ -453,13 +453,13 @@ void RemoveDuplicatesTest::removeDuplicatesFuzzyIndexedInPlaceErasedWrongIndexSi #endif char indices[6*3]{}; - Vector2i data[1]; + Vector2 data[1]; std::stringstream out; Error redirectError{&out}; MeshTools::removeDuplicatesFuzzyIndexedInPlace( Containers::StridedArrayView2D{indices, {6, 3}}, - Containers::stridedArrayView(data), 2); + Containers::stridedArrayView(data)); CORRADE_COMPARE(out.str(), "MeshTools::removeDuplicatesFuzzyIndexedInPlace(): expected index type size 1, 2 or 4 but got 3\n"); }