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...
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})
FILE(COPY

View File

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