From 22adb7a2881f3afed299f4a3bebd4b1bd5001a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 24 Jun 2022 15:48:59 +0200 Subject: [PATCH] TgaImageConverter: move test data closer to the actual test cases. --- .../Test/TgaImageConverterTest.cpp | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp index 218ec21a8..85c238fbd 100644 --- a/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp +++ b/src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp @@ -68,31 +68,6 @@ constexpr struct { "Trade::TgaImageConverter::convertToData(): converting from RGBA to BGRA\n"} }; -/* Padded to four byte alignment (the resulting file is *not* padded) */ -constexpr char OriginalDataRGB[] = { - /* Skip */ - 0, 0, 0, 0, 0, 0, 0, 0, - - 1, 2, 3, 2, 3, 4, 0, 0, - 3, 4, 5, 4, 5, 6, 0, 0, - 5, 6, 7, 6, 7, 8, 0, 0 -}; -constexpr char ConvertedDataRGB[] = { - 1, 2, 3, 2, 3, 4, - 3, 4, 5, 4, 5, 6, - 5, 6, 7, 6, 7, 8 -}; - -const ImageView2D OriginalRGB{PixelStorage{}.setSkip({0, 1, 0}), - PixelFormat::RGB8Unorm, {2, 3}, OriginalDataRGB}; - -constexpr char OriginalDataRGBA[] = { - 1, 2, 3, 4, 2, 3, 4, 5, - 3, 4, 5, 6, 4, 5, 6, 7, - 5, 6, 7, 8, 6, 7, 8, 9 -}; -const ImageView2D OriginalRGBA{PixelFormat::RGBA8Unorm, {2, 3}, OriginalDataRGBA}; - TgaImageConverterTest::TgaImageConverterTest() { addTests({&TgaImageConverterTest::wrongFormat}); @@ -122,6 +97,31 @@ void TgaImageConverterTest::wrongFormat() { CORRADE_COMPARE(out.str(), "Trade::TgaImageConverter::convertToData(): unsupported pixel format PixelFormat::RG8Unorm\n"); } +/* Padded to four byte alignment (the resulting file is *not* padded) */ +constexpr char OriginalDataRGB[] = { + /* Skip */ + 0, 0, 0, 0, 0, 0, 0, 0, + + 1, 2, 3, 2, 3, 4, 0, 0, + 3, 4, 5, 4, 5, 6, 0, 0, + 5, 6, 7, 6, 7, 8, 0, 0 +}; +constexpr char ConvertedDataRGB[] = { + 1, 2, 3, 2, 3, 4, + 3, 4, 5, 4, 5, 6, + 5, 6, 7, 6, 7, 8 +}; + +const ImageView2D OriginalRGB{PixelStorage{}.setSkip({0, 1, 0}), + PixelFormat::RGB8Unorm, {2, 3}, OriginalDataRGB}; + +constexpr char OriginalDataRGBA[] = { + 1, 2, 3, 4, 2, 3, 4, 5, + 3, 4, 5, 6, 4, 5, 6, 7, + 5, 6, 7, 8, 6, 7, 8, 9 +}; +const ImageView2D OriginalRGBA{PixelFormat::RGBA8Unorm, {2, 3}, OriginalDataRGBA}; + void TgaImageConverterTest::rgb() { auto&& data = VerboseData[testCaseInstanceId()]; setTestCaseDescription(data.name);