diff --git a/src/Magnum/Math/Test/MatrixTest.cpp b/src/Magnum/Math/Test/MatrixTest.cpp index 207e96e44..15ee81c82 100644 --- a/src/Magnum/Math/Test/MatrixTest.cpp +++ b/src/Magnum/Math/Test/MatrixTest.cpp @@ -326,8 +326,9 @@ void MatrixTest::subclassTypes() { } void MatrixTest::subclass() { - const Mat2 a(Vec2(2.0f, 3.5f), - Vec2(3.0f, 1.0f)); + /* Constexpr constructor */ + constexpr Mat2 a(Vec2(2.0f, 3.5f), + Vec2(3.0f, 1.0f)); Mat2 b(Vec2(2.0f, 3.5f), Vec2(3.0f, 1.0f)); CORRADE_COMPARE(a[1], Vec2(3.0f, 1.0f)); diff --git a/src/Magnum/Math/Test/RangeTest.cpp b/src/Magnum/Math/Test/RangeTest.cpp index afec4781f..0793732b3 100644 --- a/src/Magnum/Math/Test/RangeTest.cpp +++ b/src/Magnum/Math/Test/RangeTest.cpp @@ -466,6 +466,10 @@ void RangeTest::subclassTypes() { } void RangeTest::subclass() { + /* Constexpr constructor */ + constexpr Recti a{Vector2i{34, 23}, Vector2i{47, 30}}; + CORRADE_COMPARE(a.min(), (Vector2i{34, 23})); + CORRADE_COMPARE(Recti::fromSize({3, 5}, {23, 78}), Recti(Vector2i{3, 5}, Vector2i{26, 83})); diff --git a/src/Magnum/Math/Test/RectangularMatrixTest.cpp b/src/Magnum/Math/Test/RectangularMatrixTest.cpp index 570ec772e..23c1f2d73 100644 --- a/src/Magnum/Math/Test/RectangularMatrixTest.cpp +++ b/src/Magnum/Math/Test/RectangularMatrixTest.cpp @@ -500,8 +500,9 @@ void RectangularMatrixTest::subclass() { CORRADE_COMPARE(Mat2x2::fromDiagonal({1.0f, -2.0f}), Mat2x2(Vector2(1.0f, 0.0f), Vector2(0.0f, -2.0f))); - const Mat2x2 a(Vector2(1.0f, -3.0f), - Vector2(-3.0f, 1.0f)); + /* Constexpr constructor */ + constexpr Mat2x2 a(Vector2(1.0f, -3.0f), + Vector2(-3.0f, 1.0f)); CORRADE_COMPARE(-a, Mat2x2(Vector2(-1.0f, 3.0f), Vector2(3.0f, -1.0f))); diff --git a/src/Magnum/Math/Test/VectorTest.cpp b/src/Magnum/Math/Test/VectorTest.cpp index a567e3d74..d9e5c4849 100644 --- a/src/Magnum/Math/Test/VectorTest.cpp +++ b/src/Magnum/Math/Test/VectorTest.cpp @@ -562,6 +562,10 @@ void VectorTest::subclass() { CORRADE_COMPARE(c, Vec2(5.0f, -1.0f)); } + /* Constexpr constructor */ + constexpr const Vec2 a{-2.0f, 5.0f}; + CORRADE_COMPARE(a[0], -2.0f); + CORRADE_COMPARE(Vec2(-2.0f, 5.0f) + Vec2(1.0f, -3.0f), Vec2(-1.0f, 2.0f)); CORRADE_COMPARE(Vec2(-2.0f, 5.0f) - Vec2(1.0f, -3.0f), Vec2(-3.0f, 8.0f));