diff --git a/PVRTCEncoder/src/Image.cpp b/PVRTCEncoder/src/Image.cpp index 7a7581a..515fb35 100644 --- a/PVRTCEncoder/src/Image.cpp +++ b/PVRTCEncoder/src/Image.cpp @@ -58,6 +58,11 @@ #include #include +#if _MSC_VER +# define _CRT_SECURE_NO_WARNINGS +# define snprintf _snprintf +#endif + #include "Pixel.h" #include "Core/include/Image.h" diff --git a/PVRTCEncoder/test/CMakeLists.txt b/PVRTCEncoder/test/CMakeLists.txt index 5dd45b4..af7cf7c 100644 --- a/PVRTCEncoder/test/CMakeLists.txt +++ b/PVRTCEncoder/test/CMakeLists.txt @@ -101,8 +101,16 @@ IF(PVRTEXLIB_FOUND) TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCIO) TARGET_LINK_LIBRARIES(${TEST_NAME} FasTCCore) - ADD_TEST(${TEST_NAME} - ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} - ) + IF(MSVC) + ADD_TEST(${TEST_NAME} + ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/Debug/${TEST_NAME} + ) + ELSE() + ADD_TEST(${TEST_NAME} + ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} + ) + ENDIF() + ENDIF(PVRTEXLIB_FOUND) diff --git a/PVRTCEncoder/test/DecompTestPVR.cpp b/PVRTCEncoder/test/DecompTestPVR.cpp index 592afb5..2d29aa1 100644 --- a/PVRTCEncoder/test/DecompTestPVR.cpp +++ b/PVRTCEncoder/test/DecompTestPVR.cpp @@ -96,7 +96,7 @@ class ImageTester { uint32 *libPixels = static_cast(pvrTex.getDataPtr()); - for(int i = 0; i < w*h; i++) { + for(uint32 i = 0; i < w*h; i++) { EXPECT_EQ(PixelPrinter(libPixels[i]), PixelPrinter(outPixels[i])); }