From 53a95b62963386484b5ba284564aac3105fac0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 6 Jan 2013 19:05:40 +0100 Subject: [PATCH] Math: test also parameterless Quaternion::dot(). Just to be sure (and to be consistent with Vector test). --- src/Math/Test/MathQuaternionTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Math/Test/MathQuaternionTest.cpp b/src/Math/Test/MathQuaternionTest.cpp index d4d52cf96..e134a2769 100644 --- a/src/Math/Test/MathQuaternionTest.cpp +++ b/src/Math/Test/MathQuaternionTest.cpp @@ -32,6 +32,7 @@ class QuaternionTest: public Corrade::TestSuite::Tester { void multiplyDivideScalar(); void multiply(); void dot(); + void dotSelf(); void length(); void normalized(); void conjugated(); @@ -54,6 +55,7 @@ QuaternionTest::QuaternionTest() { &QuaternionTest::multiplyDivideScalar, &QuaternionTest::multiply, &QuaternionTest::dot, + &QuaternionTest::dotSelf, &QuaternionTest::length, &QuaternionTest::normalized, &QuaternionTest::conjugated, @@ -109,6 +111,10 @@ void QuaternionTest::dot() { 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() { CORRADE_COMPARE(Quaternion({1.0f, 3.0f, -2.0f}, -4.0f).length(), std::sqrt(30.0f)); }