Browse Source

Math: update and document subclass implementation macro tests.

pull/114/merge
Vladimír Vondruš 11 years ago
parent
commit
d5359a2c36
  1. 3
      src/Magnum/Math/Test/RectangularMatrixTest.cpp
  2. 4
      src/Magnum/Math/Test/VectorTest.cpp

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

@ -556,6 +556,9 @@ void RectangularMatrixTest::subclass() {
CORRADE_COMPARE(d*2.0f, dExpected);
CORRADE_COMPARE(2.0f*d, dExpected);
/* No need to test in-place operators as the other ones are implemented
using them */
Mat2x2 e(Vector2(-2.0f, 5.0f),
Vector2(5.0f, -2.0f));
CORRADE_COMPARE(e/0.5f, dExpected);

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

@ -589,6 +589,7 @@ void VectorTest::subclass() {
constexpr const Vec2 a{-2.0f, 5.0f};
CORRADE_COMPARE(a[0], -2.0f);
CORRADE_COMPARE(-Vec2(-2.0f, 5.0f), Vec2(2.0f, -5.0f));
CORRADE_COMPARE(Vec2(-2.0f, 5.0f) + Vec2(1.0f, -3.0f), Vec2(-1.0f, 2.0f));
CORRADE_COMPARE(Vec2(-2.0f, 5.0f) - Vec2(1.0f, -3.0f), Vec2(-3.0f, 8.0f));
@ -600,6 +601,9 @@ void VectorTest::subclass() {
CORRADE_COMPARE(Vec2(-2.0f, 5.0f)*Vec2(1.5f, -2.0f), Vec2(-3.0f, -10.0f));
CORRADE_COMPARE(Vec2(-2.0f, 5.0f)/Vec2(2.0f/3.0f, -0.5f), Vec2(-3.0f, -10.0f));
/* No need to test in-place operators as the other ones are implemented
using them */
/* Modulo operations */
CORRADE_COMPARE(Vec2i(4, 13) % 2, Vec2i(0, 1));
CORRADE_COMPARE(Vec2i(4, 13) % Vec2i(2, 5), Vec2i(0, 3));

Loading…
Cancel
Save