Add 2BPP tests

This commit is contained in:
Pavel Krajcevski 2013-09-12 14:04:20 -04:00
parent 0172df4e60
commit 08cad3ba86
12 changed files with 32 additions and 12 deletions

View File

@ -76,7 +76,8 @@ IF(PVRTEXLIB_FOUND)
# Copy the .pvr files that we will use for testing... # Copy the .pvr files that we will use for testing...
SET(TEST_IMAGES SET(TEST_IMAGES
gradient white gray transparent trans-gradient 4bpp-gradient 4bpp-white 4bpp-gray 4bpp-transparent 4bpp-trans-gradient
2bpp-gradient 2bpp-white 2bpp-gray 2bpp-transparent 2bpp-trans-gradient
) )
FOREACH(IMAGE ${TEST_IMAGES}) FOREACH(IMAGE ${TEST_IMAGES})
FILE(COPY FILE(COPY

View File

@ -69,7 +69,7 @@
class ImageTester { class ImageTester {
public: public:
explicit ImageTester(const char *filename) { explicit ImageTester(const char *filename, bool twobpp) {
pvrtexture::CPVRTexture pvrTex(filename); pvrtexture::CPVRTexture pvrTex(filename);
const uint8 *data = static_cast<const uint8 *>(pvrTex.getDataPtr()); const uint8 *data = static_cast<const uint8 *>(pvrTex.getDataPtr());
@ -107,23 +107,42 @@ class ImageTester {
} }
}; };
TEST(Decompressor, DecompressGradient) { TEST(Decompressor, DecompressWhite2BPP) {
ImageTester("gradient.pvr"); ImageTester("2bpp-white.pvr", true);
} }
TEST(Decompressor, DecompressWhite) { TEST(Decompressor, DecompressGray2BPP) {
ImageTester("white.pvr"); ImageTester("2bpp-gray.pvr", true);
} }
TEST(Decompressor, DecompressGray) { TEST(Decompressor, DecompressGradient2BPP) {
ImageTester("gray.pvr"); ImageTester("2bpp-gradient.pvr", true);
} }
TEST(Decompressor, DecompressTransparent) { TEST(Decompressor, DecompressTransparent2BPP) {
ImageTester("transparent.pvr"); ImageTester("2bpp-transparent.pvr", true);
} }
TEST(Decompressor, DecompressTransGradient) { TEST(Decompressor, DecompressTransGradient2BPP) {
ImageTester("trans-gradient.pvr"); ImageTester("2bpp-trans-gradient.pvr", true);
} }
TEST(Decompressor, DecompressWhite4BPP) {
ImageTester("4bpp-white.pvr", false);
}
TEST(Decompressor, DecompressGray4BPP) {
ImageTester("4bpp-gray.pvr", false);
}
TEST(Decompressor, DecompressGradient4BPP) {
ImageTester("4bpp-gradient.pvr", false);
}
TEST(Decompressor, DecompressTransparent4BPP) {
ImageTester("4bpp-transparent.pvr", false);
}
TEST(Decompressor, DecompressTransGradient4BPP) {
ImageTester("4bpp-trans-gradient.pvr", false);
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.