From 502c15ee297976f8f64ad1e246888653796d0e68 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Tue, 2 Sep 2014 16:52:31 -0400 Subject: [PATCH] Respect the new flag in tests. Fixes #12 --- PVRTCEncoder/test/CMakeLists.txt | 5 +++++ PVRTCEncoder/test/DecompTestPVR.cpp | 16 +++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/PVRTCEncoder/test/CMakeLists.txt b/PVRTCEncoder/test/CMakeLists.txt index a399ee8..74190e0 100644 --- a/PVRTCEncoder/test/CMakeLists.txt +++ b/PVRTCEncoder/test/CMakeLists.txt @@ -56,6 +56,11 @@ INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/PVRTCEncoder/src) INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Base/include ) INCLUDE_DIRECTORIES(${FasTC_BINARY_DIR}/Base/include ) +IF( DEBUG_PVRTC_DECODER ) + INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/Core/include ) + INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/IO/include ) +ENDIF( DEBUG_PVRTC_DECODER ) + INCLUDE_DIRECTORIES(${FasTC_SOURCE_DIR}/GTest/include) SET(TESTS diff --git a/PVRTCEncoder/test/DecompTestPVR.cpp b/PVRTCEncoder/test/DecompTestPVR.cpp index af909d9..599ac0f 100644 --- a/PVRTCEncoder/test/DecompTestPVR.cpp +++ b/PVRTCEncoder/test/DecompTestPVR.cpp @@ -60,12 +60,10 @@ #include "TestUtils.h" -// #define OUTPUT_DEBUG_IMAGE - -#ifdef OUTPUT_DEBUG_IMAGE -# include "Core/include/Image.h" -# include "IO/include/ImageFile.h" -#endif // OUTPUT_DEBUG_IMAGE +#ifdef DEBUG_PVRTC_DECODER +# include "Image.h" +# include "ImageFile.h" +#endif // DEBUG_PVRTC_DECODER class ImageTester { public: @@ -88,7 +86,7 @@ class ImageTester { uint8 *outBuf = reinterpret_cast(outPixels); FasTC::DecompressionJob dcj(fmt, data, outBuf, w, h); -#ifdef OUTPUT_DEBUG_IMAGE +#ifdef DEBUG_PVRTC_DECODER PVRTCC::Decompress(dcj, PVRTCC::eWrapMode_Wrap, true); #else PVRTCC::Decompress(dcj, PVRTCC::eWrapMode_Wrap); @@ -106,10 +104,10 @@ class ImageTester { EXPECT_EQ(PixelPrinter(libPixels[i]), PixelPrinter(outPixels[i])); } -#ifdef OUTPUT_DEBUG_IMAGE +#ifdef DEBUG_PVRTC_DECODER char dbgfname[256]; snprintf(dbgfname, sizeof(dbgfname), "Debug%s.png", filename); - ::ImageFile imgFile(dbgfname, eFileFormat_PNG, ::Image(w, h, outPixels)); + ImageFile imgFile(dbgfname, eFileFormat_PNG, FasTC::Image<>(w, h, outPixels)); imgFile.Write(); #endif // OUTPUT_DEBUG_IMAGE