From 090006d8185440806207f6a9c35361a8c9316c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 17 Nov 2013 18:29:54 +0100 Subject: [PATCH] TgaImageConverter: use static data and ImageReference instead of `new`. --- .../Test/TgaImageConverterTest.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp b/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp index 3688a6dcd..a63aa1c14 100644 --- a/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp +++ b/src/Plugins/TgaImageConverter/Test/TgaImageConverterTest.cpp @@ -49,16 +49,18 @@ class TgaImageConverterTest: public TestSuite::Tester { }; namespace { - #ifndef MAGNUM_TARGET_GLES - const Image2D original(ColorFormat::BGR, ColorType::UnsignedByte, {2, 3}, new char[18] - #else - const Image2D original(ColorFormat::RGB, ColorType::UnsignedByte, {2, 3}, new char[18] - #endif - { + /** @todo `const` when ImageReference is sane */ + char originalData[] = { 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8 - }); + }; + + #ifndef MAGNUM_TARGET_GLES + const ImageReference2D original(ColorFormat::BGR, ColorType::UnsignedByte, {2, 3}, originalData); + #else + const ImageReference2D original(ColorFormat::RGB, ColorType::UnsignedByte, {2, 3}, originalData); + #endif } TgaImageConverterTest::TgaImageConverterTest() {