diff --git a/src/Magnum/Shaders/Test/DistanceFieldVectorTest.cpp b/src/Magnum/Shaders/Test/DistanceFieldVectorTest.cpp index 80ea945b8..6420f6534 100644 --- a/src/Magnum/Shaders/Test/DistanceFieldVectorTest.cpp +++ b/src/Magnum/Shaders/Test/DistanceFieldVectorTest.cpp @@ -34,53 +34,43 @@ namespace Magnum { namespace Shaders { namespace Test { namespace { struct DistanceFieldVectorTest: TestSuite::Tester { explicit DistanceFieldVectorTest(); - void constructNoCreate2D(); - void constructNoCreate3D(); - - void constructCopy2D(); - void constructCopy3D(); + template void constructNoCreate(); + template void constructCopy(); void debugFlag(); void debugFlags(); }; DistanceFieldVectorTest::DistanceFieldVectorTest() { - addTests({&DistanceFieldVectorTest::constructNoCreate2D, - &DistanceFieldVectorTest::constructNoCreate3D, + addTests({&DistanceFieldVectorTest::constructNoCreate<2>, + &DistanceFieldVectorTest::constructNoCreate<3>, - &DistanceFieldVectorTest::constructCopy2D, - &DistanceFieldVectorTest::constructCopy3D, + &DistanceFieldVectorTest::constructCopy<2>, + &DistanceFieldVectorTest::constructCopy<3>, &DistanceFieldVectorTest::debugFlag, &DistanceFieldVectorTest::debugFlags}); } -void DistanceFieldVectorTest::constructNoCreate2D() { - { - DistanceFieldVector2D shader{NoCreate}; - CORRADE_COMPARE(shader.id(), 0); - } +template void DistanceFieldVectorTest::constructNoCreate() { + setTestCaseTemplateName(std::to_string(dimensions)); - CORRADE_VERIFY(true); -} - -void DistanceFieldVectorTest::constructNoCreate3D() { { - DistanceFieldVector3D shader{NoCreate}; + DistanceFieldVector shader{NoCreate}; CORRADE_COMPARE(shader.id(), 0); } CORRADE_VERIFY(true); } -void DistanceFieldVectorTest::constructCopy2D() { - CORRADE_VERIFY(!(std::is_constructible{})); - CORRADE_VERIFY(!(std::is_assignable{})); -} +template void DistanceFieldVectorTest::constructCopy() { + setTestCaseTemplateName(std::to_string(dimensions)); + + CORRADE_VERIFY((std::is_constructible, DistanceFieldVector&&>{})); + CORRADE_VERIFY(!(std::is_constructible, const DistanceFieldVector&>{})); -void DistanceFieldVectorTest::constructCopy3D() { - CORRADE_VERIFY(!(std::is_constructible{})); - CORRADE_VERIFY(!(std::is_assignable{})); + CORRADE_VERIFY((std::is_assignable, DistanceFieldVector&&>{})); + CORRADE_VERIFY(!(std::is_assignable, const DistanceFieldVector&>{})); } void DistanceFieldVectorTest::debugFlag() { diff --git a/src/Magnum/Shaders/Test/FlatTest.cpp b/src/Magnum/Shaders/Test/FlatTest.cpp index 0d0d7b555..96bee372f 100644 --- a/src/Magnum/Shaders/Test/FlatTest.cpp +++ b/src/Magnum/Shaders/Test/FlatTest.cpp @@ -34,53 +34,43 @@ namespace Magnum { namespace Shaders { namespace Test { namespace { struct FlatTest: TestSuite::Tester { explicit FlatTest(); - void constructNoCreate2D(); - void constructNoCreate3D(); - - void constructCopy2D(); - void constructCopy3D(); + template void constructNoCreate(); + template void constructCopy(); void debugFlag(); void debugFlags(); }; FlatTest::FlatTest() { - addTests({&FlatTest::constructNoCreate2D, - &FlatTest::constructNoCreate3D, + addTests({&FlatTest::constructNoCreate<2>, + &FlatTest::constructNoCreate<3>, - &FlatTest::constructCopy2D, - &FlatTest::constructCopy3D, + &FlatTest::constructCopy<2>, + &FlatTest::constructCopy<3>, &FlatTest::debugFlag, &FlatTest::debugFlags}); } -void FlatTest::constructNoCreate2D() { - { - Flat2D shader{NoCreate}; - CORRADE_COMPARE(shader.id(), 0); - } +template void FlatTest::constructNoCreate() { + setTestCaseTemplateName(std::to_string(dimensions)); - CORRADE_VERIFY(true); -} - -void FlatTest::constructNoCreate3D() { { - Flat3D shader{NoCreate}; + Flat shader{NoCreate}; CORRADE_COMPARE(shader.id(), 0); } CORRADE_VERIFY(true); } -void FlatTest::constructCopy2D() { - CORRADE_VERIFY(!(std::is_constructible{})); - CORRADE_VERIFY(!(std::is_assignable{})); -} +template void FlatTest::constructCopy() { + setTestCaseTemplateName(std::to_string(dimensions)); + + CORRADE_VERIFY((std::is_constructible, Flat&&>{})); + CORRADE_VERIFY(!(std::is_constructible, const Flat&>{})); -void FlatTest::constructCopy3D() { - CORRADE_VERIFY(!(std::is_constructible{})); - CORRADE_VERIFY(!(std::is_assignable{})); + CORRADE_VERIFY((std::is_assignable, Flat&&>{})); + CORRADE_VERIFY(!(std::is_assignable, const Flat&>{})); } void FlatTest::debugFlag() { diff --git a/src/Magnum/Shaders/Test/VectorTest.cpp b/src/Magnum/Shaders/Test/VectorTest.cpp index ed110ddd4..5a740f179 100644 --- a/src/Magnum/Shaders/Test/VectorTest.cpp +++ b/src/Magnum/Shaders/Test/VectorTest.cpp @@ -34,53 +34,43 @@ namespace Magnum { namespace Shaders { namespace Test { namespace { struct VectorTest: TestSuite::Tester { explicit VectorTest(); - void constructNoCreate2D(); - void constructNoCreate3D(); - - void constructCopy2D(); - void constructCopy3D(); + template void constructNoCreate(); + template void constructCopy(); void debugFlag(); void debugFlags(); }; VectorTest::VectorTest() { - addTests({&VectorTest::constructNoCreate2D, - &VectorTest::constructNoCreate3D, + addTests({&VectorTest::constructNoCreate<2>, + &VectorTest::constructNoCreate<3>, - &VectorTest::constructCopy2D, - &VectorTest::constructCopy3D, + &VectorTest::constructCopy<2>, + &VectorTest::constructCopy<3>, &VectorTest::debugFlag, &VectorTest::debugFlags}); } -void VectorTest::constructNoCreate2D() { - { - Vector2D shader{NoCreate}; - CORRADE_COMPARE(shader.id(), 0); - } +template void VectorTest::constructNoCreate() { + setTestCaseTemplateName(std::to_string(dimensions)); - CORRADE_VERIFY(true); -} - -void VectorTest::constructNoCreate3D() { { - Vector3D shader{NoCreate}; + Vector shader{NoCreate}; CORRADE_COMPARE(shader.id(), 0); } CORRADE_VERIFY(true); } -void VectorTest::constructCopy2D() { - CORRADE_VERIFY(!(std::is_constructible{})); - CORRADE_VERIFY(!(std::is_assignable{})); -} +template void VectorTest::constructCopy() { + setTestCaseTemplateName(std::to_string(dimensions)); + + CORRADE_VERIFY((std::is_constructible, Vector&&>{})); + CORRADE_VERIFY(!(std::is_constructible, const Vector&>{})); -void VectorTest::constructCopy3D() { - CORRADE_VERIFY(!(std::is_constructible{})); - CORRADE_VERIFY(!(std::is_assignable{})); + CORRADE_VERIFY((std::is_assignable, Vector&&>{})); + CORRADE_VERIFY(!(std::is_assignable, const Vector&>{})); } void VectorTest::debugFlag() { diff --git a/src/Magnum/Shaders/Test/VertexColorTest.cpp b/src/Magnum/Shaders/Test/VertexColorTest.cpp index b5db9985c..ba9921b4f 100644 --- a/src/Magnum/Shaders/Test/VertexColorTest.cpp +++ b/src/Magnum/Shaders/Test/VertexColorTest.cpp @@ -32,47 +32,38 @@ namespace Magnum { namespace Shaders { namespace Test { namespace { struct VertexColorTest: TestSuite::Tester { explicit VertexColorTest(); - void constructNoCreate2D(); - void constructNoCreate3D(); - - void constructCopy2D(); - void constructCopy3D(); + template void constructNoCreate(); + template void constructCopy(); }; VertexColorTest::VertexColorTest() { - addTests({&VertexColorTest::constructNoCreate2D, - &VertexColorTest::constructNoCreate3D, + addTests({ + &VertexColorTest::constructNoCreate<2>, + &VertexColorTest::constructNoCreate<3>, - &VertexColorTest::constructCopy2D, - &VertexColorTest::constructCopy3D}); + &VertexColorTest::constructCopy<2>, + &VertexColorTest::constructCopy<3>}); } -void VertexColorTest::constructNoCreate2D() { - { - VertexColor2D shader{NoCreate}; - CORRADE_COMPARE(shader.id(), 0); - } +template void VertexColorTest::constructNoCreate() { + setTestCaseTemplateName(std::to_string(dimensions)); - CORRADE_VERIFY(true); -} - -void VertexColorTest::constructNoCreate3D() { { - VertexColor3D shader{NoCreate}; + VertexColor shader{NoCreate}; CORRADE_COMPARE(shader.id(), 0); } CORRADE_VERIFY(true); } -void VertexColorTest::constructCopy2D() { - CORRADE_VERIFY(!(std::is_constructible{})); - CORRADE_VERIFY(!(std::is_assignable{})); -} +template void VertexColorTest::constructCopy() { + setTestCaseTemplateName(std::to_string(dimensions)); + + CORRADE_VERIFY((std::is_constructible, VertexColor&&>{})); + CORRADE_VERIFY(!(std::is_constructible, const VertexColor&>{})); -void VertexColorTest::constructCopy3D() { - CORRADE_VERIFY(!(std::is_constructible{})); - CORRADE_VERIFY(!(std::is_assignable{})); + CORRADE_VERIFY((std::is_assignable, VertexColor&&>{})); + CORRADE_VERIFY(!(std::is_assignable, const VertexColor&>{})); } }}}}