From 413e2e67352859d593f4d6500376eaa7ee7b01f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 21 Jun 2015 01:38:18 +0200 Subject: [PATCH] Math: properly test that these constructors are indeed implicit. --- src/Magnum/Math/Test/ComplexTest.cpp | 2 +- src/Magnum/Math/Test/DualComplexTest.cpp | 2 +- src/Magnum/Math/Test/DualQuaternionTest.cpp | 2 +- src/Magnum/Math/Test/DualTest.cpp | 2 +- src/Magnum/Math/Test/QuaternionTest.cpp | 2 +- src/Magnum/Math/Test/RangeTest.cpp | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Magnum/Math/Test/ComplexTest.cpp b/src/Magnum/Math/Test/ComplexTest.cpp index 9228e77f8..55253b8bd 100644 --- a/src/Magnum/Math/Test/ComplexTest.cpp +++ b/src/Magnum/Math/Test/ComplexTest.cpp @@ -132,7 +132,7 @@ typedef Math::Matrix3 Matrix3; typedef Math::Matrix2x2 Matrix2x2; void ComplexTest::construct() { - constexpr Complex a(0.5f, -3.7f); + constexpr Complex a = {0.5f, -3.7f}; CORRADE_COMPARE(a, Complex(0.5f, -3.7f)); constexpr Float b = a.real(); diff --git a/src/Magnum/Math/Test/DualComplexTest.cpp b/src/Magnum/Math/Test/DualComplexTest.cpp index 55dd3d4d3..92e989aad 100644 --- a/src/Magnum/Math/Test/DualComplexTest.cpp +++ b/src/Magnum/Math/Test/DualComplexTest.cpp @@ -129,7 +129,7 @@ DualComplexTest::DualComplexTest() { } void DualComplexTest::construct() { - constexpr DualComplex a({-1.0f, 2.5f}, {3.0f, -7.5f}); + constexpr DualComplex a = {{-1.0f, 2.5f}, {3.0f, -7.5f}}; CORRADE_COMPARE(a, DualComplex({-1.0f, 2.5f}, {3.0f, -7.5f})); constexpr Complex b = a.real(); diff --git a/src/Magnum/Math/Test/DualQuaternionTest.cpp b/src/Magnum/Math/Test/DualQuaternionTest.cpp index 59a1912fd..7ba8a8062 100644 --- a/src/Magnum/Math/Test/DualQuaternionTest.cpp +++ b/src/Magnum/Math/Test/DualQuaternionTest.cpp @@ -129,7 +129,7 @@ DualQuaternionTest::DualQuaternionTest() { } void DualQuaternionTest::construct() { - constexpr DualQuaternion a({{1.0f, 2.0f, 3.0f}, -4.0f}, {{0.5f, -3.1f, 3.3f}, 2.0f}); + constexpr DualQuaternion a = {{{1.0f, 2.0f, 3.0f}, -4.0f}, {{0.5f, -3.1f, 3.3f}, 2.0f}}; CORRADE_COMPARE(a, DualQuaternion({{1.0f, 2.0f, 3.0f}, -4.0f}, {{0.5f, -3.1f, 3.3f}, 2.0f})); constexpr Quaternion b = a.real(); diff --git a/src/Magnum/Math/Test/DualTest.cpp b/src/Magnum/Math/Test/DualTest.cpp index 41a716eb7..999959b9f 100644 --- a/src/Magnum/Math/Test/DualTest.cpp +++ b/src/Magnum/Math/Test/DualTest.cpp @@ -71,7 +71,7 @@ DualTest::DualTest() { } void DualTest::construct() { - constexpr Dual a(2.0f, -7.5f); + constexpr Dual a = {2.0f, -7.5f}; constexpr Float b = a.real(); constexpr Float c = a.dual(); CORRADE_COMPARE(b, 2.0f); diff --git a/src/Magnum/Math/Test/QuaternionTest.cpp b/src/Magnum/Math/Test/QuaternionTest.cpp index bd8d19753..e5992882c 100644 --- a/src/Magnum/Math/Test/QuaternionTest.cpp +++ b/src/Magnum/Math/Test/QuaternionTest.cpp @@ -139,7 +139,7 @@ QuaternionTest::QuaternionTest() { } void QuaternionTest::construct() { - constexpr Quaternion a({1.0f, 2.0f, 3.0f}, -4.0f); + constexpr Quaternion a = {{1.0f, 2.0f, 3.0f}, -4.0f}; CORRADE_COMPARE(a, Quaternion({1.0f, 2.0f, 3.0f}, -4.0f)); constexpr Vector3 b = a.vector(); diff --git a/src/Magnum/Math/Test/RangeTest.cpp b/src/Magnum/Math/Test/RangeTest.cpp index 53d647a82..afec4781f 100644 --- a/src/Magnum/Math/Test/RangeTest.cpp +++ b/src/Magnum/Math/Test/RangeTest.cpp @@ -165,9 +165,9 @@ RangeTest::RangeTest() { } void RangeTest::construct() { - constexpr Range1Di a(3, 23); - constexpr Range2Di b({3, 5}, {23, 78}); - constexpr Range3Di c({3, 5, -7}, {23, 78, 2}); + constexpr Range1Di a = {3, 23}; + constexpr Range2Di b = {{3, 5}, {23, 78}}; + constexpr Range3Di c = {{3, 5, -7}, {23, 78, 2}}; CORRADE_COMPARE(a, (Range<1, Int>(3, 23))); CORRADE_COMPARE(b, (Range<2, Int>({3, 5}, {23, 78})));