Browse Source

Math: fun with printing NaNs :(

pull/286/merge
Vladimír Vondruš 8 years ago
parent
commit
5792d7f06a
  1. 18
      src/Magnum/Math/Test/Matrix3Test.cpp
  2. 22
      src/Magnum/Math/Test/Matrix4Test.cpp

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

@ -462,6 +462,23 @@ void Matrix3Test::rotationPartNotOrthogonal() {
Matrix3::shearingX(1.5f).rotation();
Matrix3::scaling(Vector2::yScale(0.0f)).rotation();
#if defined(CORRADE_TARGET_APPLE) || (defined(CORRADE_TARGET_WINDOWS) && defined(__MINGW32__)) || defined(CORRADE_TARGET_ANDROID)
CORRADE_COMPARE(out.str(),
"Math::Matrix3::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, 0.83205,\n"
" 0, 0.5547)\n"
"Math::Matrix3::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, nan,\n"
" 0, nan)\n");
#elif defined(CORRADE_TARGET_WINDOWS) && defined(_MSC_VER)
CORRADE_COMPARE(out.str(),
"Math::Matrix3::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, 0.83205,\n"
" 0, 0.5547)\n"
"Math::Matrix3::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, -nan(ind),\n"
" 0, -nan(ind))\n");
#else
CORRADE_COMPARE(out.str(),
"Math::Matrix3::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, 0.83205,\n"
@ -469,6 +486,7 @@ void Matrix3Test::rotationPartNotOrthogonal() {
"Math::Matrix3::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, -nan,\n"
" 0, -nan)\n");
#endif
}
void Matrix3Test::rotationNormalizedPart() {

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

@ -617,6 +617,27 @@ void Matrix4Test::rotationPartNotOrthogonal() {
Matrix4::shearingXY(1.5f, 0.0f).rotation();
Matrix4::scaling(Vector3::yScale(0.0f)).rotation();
#if defined(CORRADE_TARGET_APPLE) || (defined(CORRADE_TARGET_WINDOWS) && defined(__MINGW32__)) || defined(CORRADE_TARGET_ANDROID)
CORRADE_COMPARE(out.str(),
"Math::Matrix4::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, 0, 0.83205,\n"
" 0, 1, 0,\n"
" 0, 0, 0.5547)\n"
"Math::Matrix4::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, nan, 0,\n"
" 0, nan, 0,\n"
" 0, nan, 1)\n");
#elif defined(CORRADE_TARGET_WINDOWS) && defined(_MSC_VER)
CORRADE_COMPARE(out.str(),
"Math::Matrix4::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, 0, 0.83205,\n"
" 0, 1, 0,\n"
" 0, 0, 0.5547)\n"
"Math::Matrix4::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, -nan(ind), 0,\n"
" 0, -nan(ind), 0,\n"
" 0, -nan(ind), 1)\n");
#else
CORRADE_COMPARE(out.str(),
"Math::Matrix4::rotation(): the normalized rotation part is not orthogonal:\n"
"Matrix(1, 0, 0.83205,\n"
@ -626,6 +647,7 @@ void Matrix4Test::rotationPartNotOrthogonal() {
"Matrix(1, -nan, 0,\n"
" 0, -nan, 0,\n"
" 0, -nan, 1)\n");
#endif
}
void Matrix4Test::rotationNormalizedPart() {

Loading…
Cancel
Save