Changeset 1107


Ignore:
Timestamp:
Dec 10, 2011, 3:02:08 PM (9 years ago)
Author:
sam
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/quat.cpp

    r1049 r1107  
    118118        quat b = re(a);
    119119
    120         LOLUNIT_ASSERT_EQUAL(a * b, b * a);
     120        quat m1 = a * b;
     121        quat m2 = b * a;
     122        LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.x, m2.x, 1e-8);
     123        LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.y, m2.y, 1e-8);
     124        LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.z, m2.z, 1e-8);
     125        LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.w, m2.w, 1e-8);
    121126
    122         quat c = 1.0f;
    123 
    124         LOLUNIT_ASSERT_EQUAL(a * b, c);
     127        LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.x, 0.0, 1e-8);
     128        LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.y, 0.0, 1e-8);
     129        LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.z, 0.0, 1e-8);
     130        LOLUNIT_ASSERT_DOUBLES_EQUAL(m1.w, 1.0, 1e-8);
    125131    }
    126132};
Note: See TracChangeset for help on using the changeset viewer.