Changes between Version 8 and Version 9 of oss/lolunit/tutorial


Ignore:
Timestamp:
Sep 8, 2011, 10:29:47 PM (8 years ago)
Author:
sam
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • oss/lolunit/tutorial

    v8 v9  
    4545 * `LOLUNIT_ASSERT_EQUAL(a, b)` will cause the current test to fail if `a` and `b` are not equal.
    4646 * `LOLUNIT_ASSERT_DOUBLES_EQUAL(a, b, t)` will cause the current test to fail if the floating point values `a` and `b` are not equal, with a tolerance of `t`.
     47 * all other comparison checks and their negations are available: `LOLUNIT_ASSERT_GREATER`, `LOLUNIT_ASSERT_NOT_GREATER`, etc.
    4748
    4849This is how to populate our fixture:
     
    5556    {
    5657        LOLUNIT_ASSERT_EQUAL(1 + 1, 2);
    57         LOLUNIT_ASSERT(2 + 2 < 5); /* Check that our value for 2 is not too large */
     58        LOLUNIT_ASSERT_LESS(2 + 2, 5); /* Check that our value for 2 is not too large */
     59        LOLUNIT_ASSERT_NOT_GEQUAL(2 + 2, 5);
    5860    }
    5961
     
    146148        CPPUNIT_ASSERT_EQUAL(1 + 1, 2);
    147149        CPPUNIT_ASSERT(2 + 2 < 5); /* Check that our value for 2 is not too large */
     150        CPPUNIT_ASSERT(!(2 + 2 >= 5));
    148151    }
    149152