From 2f4cd789b6b9ffba9724b9cac84faf1d7ecb3ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 20 Jan 2022 22:01:19 +0100 Subject: [PATCH] MeshTools: minor cleanup in some tests. --- src/Magnum/MeshTools/Test/CompressIndicesTest.cpp | 5 +++-- src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp | 6 ++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp index e849e8429..3ddcf22be 100644 --- a/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp +++ b/src/Magnum/MeshTools/Test/CompressIndicesTest.cpp @@ -347,12 +347,13 @@ void CompressIndicesTest::compressMeshDataNonIndexed() { CORRADE_SKIP("CORRADE_NO_ASSERT defined, can't test assertions"); #endif + Trade::MeshData mesh{MeshPrimitive::TriangleFan, 5}; + /* Test both r-value and l-value overload */ std::ostringstream out; Error redirectError{&out}; - Trade::MeshData mesh{MeshPrimitive::TriangleFan, 5}; MeshTools::compressIndices(mesh); - MeshTools::compressIndices(Trade::MeshData{MeshPrimitive::TriangleFan, 5}); + MeshTools::compressIndices(std::move(mesh)); CORRADE_COMPARE(out.str(), "MeshTools::compressIndices(): mesh data not indexed\n" "MeshTools::compressIndices(): mesh data not indexed\n"); diff --git a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp index 0236239a6..69dd08f70 100644 --- a/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp +++ b/src/Magnum/MeshTools/Test/RemoveDuplicatesTest.cpp @@ -850,8 +850,7 @@ void RemoveDuplicatesTest::removeDuplicatesMeshDataImplementationSpecificVertexF std::ostringstream out; Error redirectError{&out}; MeshTools::removeDuplicates(Trade::MeshData{MeshPrimitive::Points, nullptr, { - Trade::MeshAttributeData{Trade::MeshAttribute::Position, - VertexFormat::Vector3, nullptr}, + Trade::MeshAttributeData{Trade::MeshAttribute::Position, VertexFormat::Vector3, nullptr}, Trade::MeshAttributeData{Trade::MeshAttribute::Normal, vertexFormatWrap(0xcaca), nullptr} }}); CORRADE_COMPARE(out.str(), @@ -1200,8 +1199,7 @@ void RemoveDuplicatesTest::removeDuplicatesMeshDataFuzzyImplementationSpecificVe std::ostringstream out; Error redirectError{&out}; MeshTools::removeDuplicatesFuzzy(Trade::MeshData{MeshPrimitive::Points, nullptr, { - Trade::MeshAttributeData{Trade::MeshAttribute::Position, - VertexFormat::Vector3, nullptr}, + Trade::MeshAttributeData{Trade::MeshAttribute::Position, VertexFormat::Vector3, nullptr}, Trade::MeshAttributeData{Trade::MeshAttribute::Normal, vertexFormatWrap(0xcaca), nullptr} }}); CORRADE_COMPARE(out.str(),