Browse Source

test: do not test for strict doubles equality in quaternion unit test.

legacy
Sam Hocevar sam 13 years ago
parent
commit
2d3ee50da3
1 changed files with 11 additions and 5 deletions
  1. +11
    -5
      test/unit/quat.cpp

+ 11
- 5
test/unit/quat.cpp View File

@@ -117,11 +117,17 @@ LOLUNIT_FIXTURE(QuaternionTest)
quat a(2.0f, -2.0f, -8.0f, 3.0f);
quat b = re(a);

LOLUNIT_ASSERT_EQUAL(a * b, b * a);

quat c = 1.0f;

LOLUNIT_ASSERT_EQUAL(a * b, c);
quat m1 = a * b;
quat m2 = b * a;
LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.x, m2.x, 1e-8);
LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.y, m2.y, 1e-8);
LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.z, m2.z, 1e-8);
LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.w, m2.w, 1e-8);

LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.x, 0.0, 1e-8);
LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.y, 0.0, 1e-8);
LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.z, 0.0, 1e-8);
LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.w, 1.0, 1e-8);
}
};



Loading…
Cancel
Save