Browse Source

TgaImageConverter: move test data closer to the actual test cases.

pull/578/head
Vladimír Vondruš 4 years ago
parent
commit
22adb7a288
  1. 50
      src/MagnumPlugins/TgaImageConverter/Test/TgaImageConverterTest.cpp

50
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);

Loading…
Cancel
Save