Browse Source

Math: verify that the NoInit constructors are explicit.

pull/190/head
Vladimír Vondruš 10 years ago
parent
commit
70ef473710
  1. 4
      src/Magnum/Math/Test/AngleTest.cpp
  2. 3
      src/Magnum/Math/Test/BezierTest.cpp
  3. 3
      src/Magnum/Math/Test/BoolVectorTest.cpp
  4. 4
      src/Magnum/Math/Test/ColorTest.cpp
  5. 3
      src/Magnum/Math/Test/ComplexTest.cpp
  6. 3
      src/Magnum/Math/Test/DualComplexTest.cpp
  7. 3
      src/Magnum/Math/Test/DualQuaternionTest.cpp
  8. 4
      src/Magnum/Math/Test/DualTest.cpp
  9. 3
      src/Magnum/Math/Test/Matrix3Test.cpp
  10. 3
      src/Magnum/Math/Test/Matrix4Test.cpp
  11. 3
      src/Magnum/Math/Test/MatrixTest.cpp
  12. 3
      src/Magnum/Math/Test/QuaternionTest.cpp
  13. 5
      src/Magnum/Math/Test/RangeTest.cpp
  14. 3
      src/Magnum/Math/Test/RectangularMatrixTest.cpp
  15. 3
      src/Magnum/Math/Test/UnitTest.cpp
  16. 3
      src/Magnum/Math/Test/Vector2Test.cpp
  17. 3
      src/Magnum/Math/Test/Vector3Test.cpp
  18. 3
      src/Magnum/Math/Test/Vector4Test.cpp
  19. 3
      src/Magnum/Math/Test/VectorTest.cpp

4
src/Magnum/Math/Test/AngleTest.cpp

@ -123,6 +123,10 @@ void AngleTest::constructNoInit() {
CORRADE_VERIFY((std::is_nothrow_constructible<Deg, NoInitT>::value));
CORRADE_VERIFY((std::is_nothrow_constructible<Rad, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Deg>::value));
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Rad>::value));
}
void AngleTest::constructConversion() {

3
src/Magnum/Math/Test/BezierTest.cpp

@ -116,6 +116,9 @@ void BezierTest::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<QuadraticBezier2D, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, QuadraticBezier2D>::value));
}
void BezierTest::constructConversion() {

3
src/Magnum/Math/Test/BoolVectorTest.cpp

@ -110,6 +110,9 @@ void BoolVectorTest::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<BoolVector19, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, BoolVector19>::value));
}
void BoolVectorTest::constructOneValue() {

4
src/Magnum/Math/Test/ColorTest.cpp

@ -197,6 +197,10 @@ void ColorTest::constructNoInit() {
CORRADE_VERIFY((std::is_nothrow_constructible<Color3, NoInitT>::value));
CORRADE_VERIFY((std::is_nothrow_constructible<Color4, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Color3>::value));
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Color4>::value));
}
void ColorTest::constructOneValue() {

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

@ -183,6 +183,9 @@ void ComplexTest::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Complex, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Complex>::value));
}
void ComplexTest::constructFromVector() {

3
src/Magnum/Math/Test/DualComplexTest.cpp

@ -186,6 +186,9 @@ void DualComplexTest::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<DualComplex, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, DualComplex>::value));
}
void DualComplexTest::constructFromVector() {

3
src/Magnum/Math/Test/DualQuaternionTest.cpp

@ -208,6 +208,9 @@ void DualQuaternionTest::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<DualQuaternion, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, DualQuaternion>::value));
}
void DualQuaternionTest::constructFromVector() {

4
src/Magnum/Math/Test/DualTest.cpp

@ -147,6 +147,10 @@ void DualTest::constructNoInit() {
CORRADE_VERIFY((std::is_nothrow_constructible<Dual, NoInitT>::value));
CORRADE_VERIFY((std::is_nothrow_constructible<Math::Dual<Math::Quaternion<Float>>, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Dual>::value));
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Math::Dual<Math::Quaternion<Float>>>::value));
}
void DualTest::constructConversion() {

3
src/Magnum/Math/Test/Matrix3Test.cpp

@ -185,6 +185,9 @@ void Matrix3Test::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Matrix3, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Matrix3>::value));
}
void Matrix3Test::constructConversion() {

3
src/Magnum/Math/Test/Matrix4Test.cpp

@ -219,6 +219,9 @@ void Matrix4Test::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Matrix4, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Matrix4>::value));
}
void Matrix4Test::constructConversion() {

3
src/Magnum/Math/Test/MatrixTest.cpp

@ -177,6 +177,9 @@ void MatrixTest::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Matrix4x4, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Matrix4x4>::value));
}
void MatrixTest::constructConversion() {

3
src/Magnum/Math/Test/QuaternionTest.cpp

@ -191,6 +191,9 @@ void QuaternionTest::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Quaternion, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Quaternion>::value));
}
void QuaternionTest::constructFromVector() {

5
src/Magnum/Math/Test/RangeTest.cpp

@ -228,6 +228,11 @@ void RangeTest::constructNoInit() {
CORRADE_VERIFY((std::is_nothrow_constructible<Range1Di, NoInitT>::value));
CORRADE_VERIFY((std::is_nothrow_constructible<Range2Di, NoInitT>::value));
CORRADE_VERIFY((std::is_nothrow_constructible<Range3Di, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Range1Di>::value));
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Range2Di>::value));
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Range3Di>::value));
}
void RangeTest::constructFromSize() {

3
src/Magnum/Math/Test/RectangularMatrixTest.cpp

@ -185,6 +185,9 @@ void RectangularMatrixTest::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Matrix3x4, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Matrix3x4>::value));
}
void RectangularMatrixTest::constructConversion() {

3
src/Magnum/Math/Test/UnitTest.cpp

@ -99,6 +99,9 @@ void UnitTest::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Sec, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Sec>::value));
}
void UnitTest::constructConversion() {

3
src/Magnum/Math/Test/Vector2Test.cpp

@ -129,6 +129,9 @@ void Vector2Test::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Vector2, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Vector2>::value));
}
void Vector2Test::constructOneValue() {

3
src/Magnum/Math/Test/Vector3Test.cpp

@ -127,6 +127,9 @@ void Vector3Test::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Vector3, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Vector3>::value));
}
void Vector3Test::constructOneValue() {

3
src/Magnum/Math/Test/Vector4Test.cpp

@ -142,6 +142,9 @@ void Vector4Test::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Vector4, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Vector4>::value));
}
void Vector4Test::constructOneValue() {

3
src/Magnum/Math/Test/VectorTest.cpp

@ -216,6 +216,9 @@ void VectorTest::constructNoInit() {
}
CORRADE_VERIFY((std::is_nothrow_constructible<Vector4, NoInitT>::value));
/* Implicit construction is not allowed */
CORRADE_VERIFY(!(std::is_convertible<NoInitT, Vector4>::value));
}
void VectorTest::constructOneValue() {

Loading…
Cancel
Save