Browse Source

Math: test also parameterless Quaternion::dot().

Just to be sure (and to be consistent with Vector test).
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
53a95b6296
  1. 6
      src/Math/Test/MathQuaternionTest.cpp

6
src/Math/Test/MathQuaternionTest.cpp

@ -32,6 +32,7 @@ class QuaternionTest: public Corrade::TestSuite::Tester {
void multiplyDivideScalar(); void multiplyDivideScalar();
void multiply(); void multiply();
void dot(); void dot();
void dotSelf();
void length(); void length();
void normalized(); void normalized();
void conjugated(); void conjugated();
@ -54,6 +55,7 @@ QuaternionTest::QuaternionTest() {
&QuaternionTest::multiplyDivideScalar, &QuaternionTest::multiplyDivideScalar,
&QuaternionTest::multiply, &QuaternionTest::multiply,
&QuaternionTest::dot, &QuaternionTest::dot,
&QuaternionTest::dotSelf,
&QuaternionTest::length, &QuaternionTest::length,
&QuaternionTest::normalized, &QuaternionTest::normalized,
&QuaternionTest::conjugated, &QuaternionTest::conjugated,
@ -109,6 +111,10 @@ void QuaternionTest::dot() {
CORRADE_COMPARE(Quaternion::dot(a, b), -50.0f); CORRADE_COMPARE(Quaternion::dot(a, b), -50.0f);
} }
void QuaternionTest::dotSelf() {
CORRADE_COMPARE(Quaternion({1.0f, 2.0f, -3.0f}, -4.0f).dot(), 30.0f);
}
void QuaternionTest::length() { void QuaternionTest::length() {
CORRADE_COMPARE(Quaternion({1.0f, 3.0f, -2.0f}, -4.0f).length(), std::sqrt(30.0f)); CORRADE_COMPARE(Quaternion({1.0f, 3.0f, -2.0f}, -4.0f).length(), std::sqrt(30.0f));
} }

Loading…
Cancel
Save