Changeset 975 for trunk/test/unit


Ignore:
Timestamp:
Sep 22, 2011, 6:16:42 PM (11 years ago)
Author:
sam
Message:

core: implement division of reals and change their default precision
to 32 bigits.

File:
1 edited

Legend:

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

    r974 r975  
    111111        LOLUNIT_ASSERT_EQUAL(m4, -1.5f * -1.5f);
    112112    }
     113
     114    LOLUNIT_TEST(test_real_div)
     115    {
     116        real a1(1.0f);
     117        real a2(2.0f);
     118
     119        float m1 = a1 / a1;
     120        float m2 = a2 / a1;
     121        float m3 = a1 / a2;
     122        float m4 = a2 / a2;
     123
     124        LOLUNIT_ASSERT_EQUAL(m1, 1.0f);
     125        LOLUNIT_ASSERT_EQUAL(m2, 2.0f);
     126        LOLUNIT_ASSERT_EQUAL(m3, 0.5f);
     127        LOLUNIT_ASSERT_EQUAL(m4, 1.0f);
     128    }
    113129};
    114130
Note: See TracChangeset for help on using the changeset viewer.