Browse Source

Math: test that implicit conversion of underlying type can't compile.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
1d5e3fee7a
  1. 3
      src/Math/Test/Matrix3Test.cpp
  2. 3
      src/Math/Test/Matrix4Test.cpp
  3. 3
      src/Math/Test/MatrixTest.cpp
  4. 3
      src/Math/Test/RectangularMatrixTest.cpp
  5. 3
      src/Math/Test/Vector2Test.cpp
  6. 3
      src/Math/Test/Vector3Test.cpp
  7. 3
      src/Math/Test/Vector4Test.cpp
  8. 3
      src/Math/Test/VectorTest.cpp

3
src/Math/Test/Matrix3Test.cpp

@ -135,6 +135,9 @@ void Matrix3Test::constructConversion() {
CORRADE_COMPARE(b, Matrix3i({3, 5, 8},
{4, 4, 7},
{7, -1, 8}));
/* Implicit conversion is not allowed */
CORRADE_VERIFY(!(std::is_convertible<Matrix3, Matrix3i>::value));
}
void Matrix3Test::constructCopy() {

3
src/Math/Test/Matrix4Test.cpp

@ -154,6 +154,9 @@ void Matrix4Test::constructConversion() {
{4, 4, 7, 2},
{1, 2, 3, -1},
{7, -1, 8, -1}));
/* Implicit conversion is not allowed */
CORRADE_VERIFY(!(std::is_convertible<Matrix4, Matrix4i>::value));
}
void Matrix4Test::constructCopy() {

3
src/Math/Test/MatrixTest.cpp

@ -132,6 +132,9 @@ void MatrixTest::constructConversion() {
Vector4i(4, 4, 7, 2),
Vector4i(1, 2, 3, -1),
Vector4i(7, -1, 8, -1)));
/* Implicit conversion is not allowed */
CORRADE_VERIFY(!(std::is_convertible<Matrix4, Matrix4i>::value));
}
void MatrixTest::constructCopy() {

3
src/Math/Test/RectangularMatrixTest.cpp

@ -134,6 +134,9 @@ void RectangularMatrixTest::constructConversion() {
CORRADE_COMPARE(b, Matrix2i(Vector2i( 1, 2),
Vector2i(-15, 7)));
/* Implicit conversion is not allowed */
CORRADE_VERIFY(!(std::is_convertible<Matrix2, Matrix2i>::value));
}
void RectangularMatrixTest::constructFromData() {

3
src/Math/Test/Vector2Test.cpp

@ -120,6 +120,9 @@ void Vector2Test::constructConversion() {
Vector2i b(a); /* Not constexpr under GCC < 4.7 */
#endif
CORRADE_COMPARE(b, Vector2i(1, 2));
/* Implicit conversion is not allowed */
CORRADE_VERIFY(!(std::is_convertible<Vector2, Vector2i>::value));
}
void Vector2Test::constructCopy() {

3
src/Math/Test/Vector3Test.cpp

@ -133,6 +133,9 @@ void Vector3Test::constructConversion() {
Vector3i b(a); /* Not constexpr under GCC < 4.7 */
#endif
CORRADE_COMPARE(b, Vector3i(1, 2, -3));
/* Implicit conversion is not allowed */
CORRADE_VERIFY(!(std::is_convertible<Vector3, Vector3i>::value));
}
void Vector3Test::constructCopy() {

3
src/Math/Test/Vector4Test.cpp

@ -130,6 +130,9 @@ void Vector4Test::constructConversion() {
Vector4i b(a); /* Not constexpr under GCC < 4.7 */
#endif
CORRADE_COMPARE(b, Vector4i(1, -2, 3, 4));
/* Implicit conversion is not allowed */
CORRADE_VERIFY(!(std::is_convertible<Vector4, Vector4i>::value));
}
void Vector4Test::constructCopy() {

3
src/Math/Test/VectorTest.cpp

@ -187,6 +187,9 @@ void VectorTest::constructConversion() {
#endif
CORRADE_COMPARE(b, Vector4i(1, 2, -15, 7));
/* Implicit conversion is not allowed */
CORRADE_VERIFY(!(std::is_convertible<Vector4, Vector4i>::value));
}
void VectorTest::constructCopy() {

Loading…
Cancel
Save