Browse Source

Math: properly test that these constructors are indeed implicit.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
413e2e6735
  1. 2
      src/Magnum/Math/Test/ComplexTest.cpp
  2. 2
      src/Magnum/Math/Test/DualComplexTest.cpp
  3. 2
      src/Magnum/Math/Test/DualQuaternionTest.cpp
  4. 2
      src/Magnum/Math/Test/DualTest.cpp
  5. 2
      src/Magnum/Math/Test/QuaternionTest.cpp
  6. 6
      src/Magnum/Math/Test/RangeTest.cpp

2
src/Magnum/Math/Test/ComplexTest.cpp

@ -132,7 +132,7 @@ typedef Math::Matrix3<Float> Matrix3;
typedef Math::Matrix2x2<Float> 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();

2
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();

2
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();

2
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);

2
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();

6
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})));

Loading…
Cancel
Save