|
|
|
@ -26,6 +26,7 @@ |
|
|
|
#include <sstream> |
|
|
|
#include <sstream> |
|
|
|
#include <Corrade/Containers/ArrayView.h> |
|
|
|
#include <Corrade/Containers/ArrayView.h> |
|
|
|
#include <Corrade/TestSuite/Tester.h> |
|
|
|
#include <Corrade/TestSuite/Tester.h> |
|
|
|
|
|
|
|
#include <Corrade/TestSuite/Compare/Container.h> |
|
|
|
#include <Corrade/Utility/Directory.h> |
|
|
|
#include <Corrade/Utility/Directory.h> |
|
|
|
|
|
|
|
|
|
|
|
#include "Magnum/ColorFormat.h" |
|
|
|
#include "Magnum/ColorFormat.h" |
|
|
|
@ -144,8 +145,8 @@ void TgaImporterTest::colorBits24() { |
|
|
|
CORRADE_COMPARE(image->format(), ColorFormat::RGB); |
|
|
|
CORRADE_COMPARE(image->format(), ColorFormat::RGB); |
|
|
|
CORRADE_COMPARE(image->size(), Vector2i(2, 3)); |
|
|
|
CORRADE_COMPARE(image->size(), Vector2i(2, 3)); |
|
|
|
CORRADE_COMPARE(image->type(), ColorType::UnsignedByte); |
|
|
|
CORRADE_COMPARE(image->type(), ColorType::UnsignedByte); |
|
|
|
CORRADE_COMPARE((std::string{image->data(), 2*3*3}), |
|
|
|
CORRADE_COMPARE_AS(image->data(), Containers::ArrayView<const char>{pixels}, |
|
|
|
(std::string{pixels, 2*3*3})); |
|
|
|
TestSuite::Compare::Container); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TgaImporterTest::colorBits32() { |
|
|
|
void TgaImporterTest::colorBits32() { |
|
|
|
@ -168,8 +169,8 @@ void TgaImporterTest::colorBits32() { |
|
|
|
CORRADE_COMPARE(image->format(), ColorFormat::RGBA); |
|
|
|
CORRADE_COMPARE(image->format(), ColorFormat::RGBA); |
|
|
|
CORRADE_COMPARE(image->size(), Vector2i(2, 3)); |
|
|
|
CORRADE_COMPARE(image->size(), Vector2i(2, 3)); |
|
|
|
CORRADE_COMPARE(image->type(), ColorType::UnsignedByte); |
|
|
|
CORRADE_COMPARE(image->type(), ColorType::UnsignedByte); |
|
|
|
CORRADE_COMPARE((std::string{image->data(), 2*3*3}), |
|
|
|
CORRADE_COMPARE_AS(image->data(), Containers::ArrayView<const char>{pixels}, |
|
|
|
(std::string{pixels, 2*3*3})); |
|
|
|
TestSuite::Compare::Container); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TgaImporterTest::grayscaleBits8() { |
|
|
|
void TgaImporterTest::grayscaleBits8() { |
|
|
|
@ -191,8 +192,8 @@ void TgaImporterTest::grayscaleBits8() { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
CORRADE_COMPARE(image->size(), Vector2i(2, 3)); |
|
|
|
CORRADE_COMPARE(image->size(), Vector2i(2, 3)); |
|
|
|
CORRADE_COMPARE(image->type(), ColorType::UnsignedByte); |
|
|
|
CORRADE_COMPARE(image->type(), ColorType::UnsignedByte); |
|
|
|
CORRADE_COMPARE((std::string{image->data(), 2*3}), |
|
|
|
CORRADE_COMPARE_AS(image->data(), Containers::ArrayView<const char>{data}.suffix(18), |
|
|
|
(std::string{data + 18, 2*3})); |
|
|
|
TestSuite::Compare::Container); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void TgaImporterTest::grayscaleBits16() { |
|
|
|
void TgaImporterTest::grayscaleBits16() { |
|
|
|
@ -225,8 +226,8 @@ void TgaImporterTest::file() { |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
CORRADE_COMPARE(image->size(), Vector2i(2, 3)); |
|
|
|
CORRADE_COMPARE(image->size(), Vector2i(2, 3)); |
|
|
|
CORRADE_COMPARE(image->type(), ColorType::UnsignedByte); |
|
|
|
CORRADE_COMPARE(image->type(), ColorType::UnsignedByte); |
|
|
|
CORRADE_COMPARE((std::string{image->data(), 2*3}), |
|
|
|
CORRADE_COMPARE_AS(image->data(), Containers::ArrayView<const char>{data}.suffix(18), |
|
|
|
(std::string{data + 18, 2*3})); |
|
|
|
TestSuite::Compare::Container); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}}} |
|
|
|
}}} |
|
|
|
|