Changeset 1028


Ignore:
Timestamp:
Oct 20, 2011, 2:38:46 AM (10 years ago)
Author:
sam
Message:

test: minor fixes to the test suite: disable optimisation tests in debug
mode, and do not call "new" when we’re not sure "delete" can be called.

Location:
trunk/test/unit
Files:
2 edited

Legend:

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

    r942 r1028  
    2121LOLUNIT_FIXTURE(BuildTest)
    2222{
     23#if !defined LOL_DEBUG
    2324    LOLUNIT_TEST(FastMath)
    2425    {
     
    3233        LOLUNIT_ASSERT_EQUAL(x, y);
    3334    }
     35#endif
    3436
    3537    LOLUNIT_TEST(FastMathOverride)
  • trunk/test/unit/image.cpp

    r978 r1028  
    2525    LOLUNIT_TEST(OpenImage)
    2626    {
    27         Image *image = new Image("data/gradient.png");
    28         LOLUNIT_ASSERT(image);
     27        Image image("data/gradient.png");
    2928
    30         ivec2 size = image->GetSize();
     29        ivec2 size = image.GetSize();
    3130        LOLUNIT_ASSERT_EQUAL(size.x, 256);
    3231        LOLUNIT_ASSERT_EQUAL(size.y, 16);
    3332
    34         uint8_t *data = (uint8_t *)image->GetData();
     33        uint8_t *data = (uint8_t *)image.GetData();
    3534        LOLUNIT_ASSERT(data);
    3635
     
    4241        LOLUNIT_ASSERT_EQUAL((int)data[255 * 4 + 1], 0xff);
    4342        LOLUNIT_ASSERT_EQUAL((int)data[255 * 4 + 2], 0xff);
    44 
    45         delete image;
    4643    }
    4744};
Note: See TracChangeset for help on using the changeset viewer.