From 4461cc909804c503f998c3ed0b8458d412d892c8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 10 Oct 2022 21:12:13 +0200 Subject: [PATCH] [WIP] Math: add Vector{2,3} tests to existing units --- src/Magnum/Math/Test/Vector2Test.cpp | 6 +++--- src/Magnum/Math/Test/Vector3Test.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Magnum/Math/Test/Vector2Test.cpp b/src/Magnum/Math/Test/Vector2Test.cpp index f6215c3348..9b225e4d84 100644 --- a/src/Magnum/Math/Test/Vector2Test.cpp +++ b/src/Magnum/Math/Test/Vector2Test.cpp @@ -197,7 +197,7 @@ void Vector2Test::convert() { } void Vector2Test::access() { - Vector2 vec(1.0f, -2.0f); + MAGNUM_CONSTEXPR14 Vector2 vec(1.0f, -2.0f); CORRADE_COMPARE(vec.x(), 1.0f); CORRADE_COMPARE(vec.y(), -2.0f); @@ -209,8 +209,8 @@ void Vector2Test::access() { } void Vector2Test::cross() { - Vector2i a(1, -1); - Vector2i b(4, 3); + MAGNUM_CONSTEXPR14 Vector2i a(1, -1); + MAGNUM_CONSTEXPR14 Vector2i b(4, 3); CORRADE_COMPARE(Math::cross(a, b), 7); CORRADE_COMPARE(Math::cross({a, 0}, {b, 0}), Vector3i(0, 0, Math::cross(a, b))); diff --git a/src/Magnum/Math/Test/Vector3Test.cpp b/src/Magnum/Math/Test/Vector3Test.cpp index 11f1326290..92ba66f926 100644 --- a/src/Magnum/Math/Test/Vector3Test.cpp +++ b/src/Magnum/Math/Test/Vector3Test.cpp @@ -206,7 +206,7 @@ void Vector3Test::convert() { } void Vector3Test::access() { - Vector3 vec(1.0f, -2.0f, 5.0f); + MAGNUM_CONSTEXPR14 Vector3 vec(1.0f, -2.0f, 5.0f); CORRADE_COMPARE(vec.x(), 1.0f); CORRADE_COMPARE(vec.r(), 1.0f); CORRADE_COMPARE(vec.y(), -2.0f); @@ -230,8 +230,8 @@ void Vector3Test::access() { } void Vector3Test::cross() { - Vector3i a(1, -1, 1); - Vector3i b(4, 3, 7); + MAGNUM_CONSTEXPR14 Vector3i a(1, -1, 1); + MAGNUM_CONSTEXPR14 Vector3i b(4, 3, 7); CORRADE_COMPARE(Math::cross(a, b), Vector3i(-10, -3, 7)); } @@ -255,7 +255,7 @@ void Vector3Test::scales() { } void Vector3Test::twoComponent() { - Vector3 a(1.0f, 2.0f, 3.0f); + MAGNUM_CONSTEXPR14 Vector3 a(1.0f, 2.0f, 3.0f); CORRADE_COMPARE(a.xy(), Vector2(1.0f, 2.0f)); constexpr Vector3 b(1.0f, 2.0f, 3.0f);