From 08cad3ba863c86aff679f5931a485e106a888c6f Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Thu, 12 Sep 2013 14:04:20 -0400 Subject: [PATCH] Add 2BPP tests --- PVRTCEncoder/test/CMakeLists.txt | 3 +- PVRTCEncoder/test/DecompTestPVR.cpp | 41 +++++++++++++----- PVRTCEncoder/test/data/2bpp-gradient.pvr | Bin 0 -> 323 bytes PVRTCEncoder/test/data/2bpp-gray.pvr | Bin 0 -> 1091 bytes .../test/data/2bpp-trans-gradient.pvr | Bin 0 -> 323 bytes PVRTCEncoder/test/data/2bpp-transparent.pvr | Bin 0 -> 323 bytes PVRTCEncoder/test/data/2bpp-white.pvr | Bin 0 -> 323 bytes .../data/{gradient.pvr => 4bpp-gradient.pvr} | Bin .../test/data/{gray.pvr => 4bpp-gray.pvr} | Bin ...s-gradient.pvr => 4bpp-trans-gradient.pvr} | Bin .../{transparent.pvr => 4bpp-transparent.pvr} | Bin .../test/data/{white.pvr => 4bpp-white.pvr} | Bin 12 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 PVRTCEncoder/test/data/2bpp-gradient.pvr create mode 100644 PVRTCEncoder/test/data/2bpp-gray.pvr create mode 100644 PVRTCEncoder/test/data/2bpp-trans-gradient.pvr create mode 100644 PVRTCEncoder/test/data/2bpp-transparent.pvr create mode 100644 PVRTCEncoder/test/data/2bpp-white.pvr rename PVRTCEncoder/test/data/{gradient.pvr => 4bpp-gradient.pvr} (100%) rename PVRTCEncoder/test/data/{gray.pvr => 4bpp-gray.pvr} (100%) rename PVRTCEncoder/test/data/{trans-gradient.pvr => 4bpp-trans-gradient.pvr} (100%) rename PVRTCEncoder/test/data/{transparent.pvr => 4bpp-transparent.pvr} (100%) rename PVRTCEncoder/test/data/{white.pvr => 4bpp-white.pvr} (100%) diff --git a/PVRTCEncoder/test/CMakeLists.txt b/PVRTCEncoder/test/CMakeLists.txt index 9d66cf5..5dd45b4 100644 --- a/PVRTCEncoder/test/CMakeLists.txt +++ b/PVRTCEncoder/test/CMakeLists.txt @@ -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 diff --git a/PVRTCEncoder/test/DecompTestPVR.cpp b/PVRTCEncoder/test/DecompTestPVR.cpp index 1031c26..6ac498a 100644 --- a/PVRTCEncoder/test/DecompTestPVR.cpp +++ b/PVRTCEncoder/test/DecompTestPVR.cpp @@ -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(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); +} diff --git a/PVRTCEncoder/test/data/2bpp-gradient.pvr b/PVRTCEncoder/test/data/2bpp-gradient.pvr new file mode 100644 index 0000000000000000000000000000000000000000..0f7227f6eafec4a32667c87b8082507c2c2417d9 GIT binary patch literal 323 zcmWFt3u0yf0!9#l1QdX55C(}OV}2k%0H_C~39ONU;Xe>`JbG{$M2GwU(d+-KUVdG<+)2{KYMW7oim!p z``Pn*Ost};(tnh13o-~WeE#y_vbSus?Aw=}k7mo}Ozj`v21h z^FJW|gX8iL`f$mYk0BpsJUpI!9!O6)eB9+cSpKjyM1J$4+Y_ctaA`j7edz{Jg6;f+ z%R3$~d93>=@a@t^J0ADHG<*y4$AkS-zJTfDWj~fYTlwhh!z*8|+*u_e`KA9QSbY0b Mko>b>!43sP+LzkeimBCXH*HY)&bha+~KoA363?x9jwSxw~qPqtT0lG&(^#ng4 zk8(+C2?6TF$FMLO0M=* zRmJ@e>PhEE%6&^BHkg0v&K>mLoo$%Ci@bV|SXbVW{&tP167Mo8r8c$6XiPN4q>@7rP7 literal 0 HcmV?d00001 diff --git a/PVRTCEncoder/test/data/2bpp-transparent.pvr b/PVRTCEncoder/test/data/2bpp-transparent.pvr new file mode 100644 index 0000000000000000000000000000000000000000..6710e11767fe25a94ed6fbc989e893e1e998a384 GIT binary patch literal 323 zcmYjLF%E)25L~=y0m{*s(8yWXOF<{e;SY#~H9wHj!pJ=dUm#DQ@B!FcoP~*nio1s< zOtQB-b32G