From 53ab6b421839172d5ca66ad00a92f7258199cd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 25 Jan 2024 18:42:41 +0100 Subject: [PATCH] Math: properly test constexpr in Vector4::rgb(). --- src/Magnum/Math/Test/Vector4Test.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Magnum/Math/Test/Vector4Test.cpp b/src/Magnum/Math/Test/Vector4Test.cpp index 298d5e724..5b9e13478 100644 --- a/src/Magnum/Math/Test/Vector4Test.cpp +++ b/src/Magnum/Math/Test/Vector4Test.cpp @@ -270,10 +270,14 @@ void Vector4Test::threeComponent() { CORRADE_COMPARE(a.rgb(), Vector3(1.0f, 2.0f, 3.0f)); constexpr Vector4 b(1.0f, 2.0f, 3.0f, 4.0f); - constexpr Vector3 c = b.xyz(); - constexpr Float d = b.xyz().y(); - CORRADE_COMPARE(c, Vector3(1.0f, 2.0f, 3.0f)); - CORRADE_COMPARE(d, 2.0f); + constexpr Vector3 c1 = b.xyz(); + constexpr Vector3 c2 = b.rgb(); + constexpr Float d1 = b.xyz().y(); + constexpr Float d2 = b.rgb().g(); + CORRADE_COMPARE(c1, Vector3(1.0f, 2.0f, 3.0f)); + CORRADE_COMPARE(c2, Vector3(1.0f, 2.0f, 3.0f)); + CORRADE_COMPARE(d1, 2.0f); + CORRADE_COMPARE(d2, 2.0f); } void Vector4Test::twoComponent() {