|
@@ -24,14 +24,13 @@ LOLUNIT_FIXTURE(ImageTest) |
|
|
{ |
|
|
{ |
|
|
LOLUNIT_TEST(OpenImage) |
|
|
LOLUNIT_TEST(OpenImage) |
|
|
{ |
|
|
{ |
|
|
Image *image = new Image("data/gradient.png"); |
|
|
|
|
|
LOLUNIT_ASSERT(image); |
|
|
|
|
|
|
|
|
Image image("data/gradient.png"); |
|
|
|
|
|
|
|
|
ivec2 size = image->GetSize(); |
|
|
|
|
|
|
|
|
ivec2 size = image.GetSize(); |
|
|
LOLUNIT_ASSERT_EQUAL(size.x, 256); |
|
|
LOLUNIT_ASSERT_EQUAL(size.x, 256); |
|
|
LOLUNIT_ASSERT_EQUAL(size.y, 16); |
|
|
LOLUNIT_ASSERT_EQUAL(size.y, 16); |
|
|
|
|
|
|
|
|
uint8_t *data = (uint8_t *)image->GetData(); |
|
|
|
|
|
|
|
|
uint8_t *data = (uint8_t *)image.GetData(); |
|
|
LOLUNIT_ASSERT(data); |
|
|
LOLUNIT_ASSERT(data); |
|
|
|
|
|
|
|
|
LOLUNIT_ASSERT_EQUAL((int)data[0], 0x00); |
|
|
LOLUNIT_ASSERT_EQUAL((int)data[0], 0x00); |
|
@@ -41,8 +40,6 @@ LOLUNIT_FIXTURE(ImageTest) |
|
|
LOLUNIT_ASSERT_EQUAL((int)data[255 * 4 + 0], 0xff); |
|
|
LOLUNIT_ASSERT_EQUAL((int)data[255 * 4 + 0], 0xff); |
|
|
LOLUNIT_ASSERT_EQUAL((int)data[255 * 4 + 1], 0xff); |
|
|
LOLUNIT_ASSERT_EQUAL((int)data[255 * 4 + 1], 0xff); |
|
|
LOLUNIT_ASSERT_EQUAL((int)data[255 * 4 + 2], 0xff); |
|
|
LOLUNIT_ASSERT_EQUAL((int)data[255 * 4 + 2], 0xff); |
|
|
|
|
|
|
|
|
delete image; |
|
|
|
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|