Changeset 973 for trunk/test/unit


Ignore:
Timestamp:
Sep 22, 2011, 9:16:02 AM (11 years ago)
Author:
sam
Message:

core: implement comparison operators for reals.

File:
1 edited

Legend:

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

    r972 r973  
    5151    }
    5252
     53    LOLUNIT_TEST(test_real_comp)
     54    {
     55        LOLUNIT_ASSERT(real(1.0f) > real(0.5f));
     56        LOLUNIT_ASSERT(real(1.0f) >= real(0.5f));
     57        LOLUNIT_ASSERT(real(1.0f) >= real(1.0f));
     58
     59        LOLUNIT_ASSERT(real(-1.0f) < real(-0.5f));
     60        LOLUNIT_ASSERT(real(-1.0f) <= real(-0.5f));
     61        LOLUNIT_ASSERT(real(-1.0f) <= real(-1.0f));
     62
     63        LOLUNIT_ASSERT(real(-1.0f) < real(0.5f));
     64        LOLUNIT_ASSERT(real(-0.5f) < real(1.0f));
     65        LOLUNIT_ASSERT(real(-1.0f) <= real(0.5f));
     66        LOLUNIT_ASSERT(real(-0.5f) <= real(1.0f));
     67
     68        LOLUNIT_ASSERT(real(1.0f) > real(-0.5f));
     69        LOLUNIT_ASSERT(real(0.5f) > real(-1.0f));
     70        LOLUNIT_ASSERT(real(1.0f) >= real(-0.5f));
     71        LOLUNIT_ASSERT(real(0.5f) >= real(-1.0f));
     72    }
     73
    5374    LOLUNIT_TEST(test_real_add)
    5475    {
Note: See TracChangeset for help on using the changeset viewer.