From 7f35671b21140331dcf93368340191cd0bce8cee Mon Sep 17 00:00:00 2001 From: tycho Date: Tue, 19 May 2015 19:53:16 +0100 Subject: Fix tests --- tests/ChunkData/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/ChunkData') diff --git a/tests/ChunkData/CMakeLists.txt b/tests/ChunkData/CMakeLists.txt index 381e11cc2..4079b7d93 100644 --- a/tests/ChunkData/CMakeLists.txt +++ b/tests/ChunkData/CMakeLists.txt @@ -4,6 +4,13 @@ enable_testing() include_directories(${CMAKE_SOURCE_DIR}/src/) + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ChunkData.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion") + set_source_files_properties(${CMAKE_SOURCE_DIR}/src/StringUtils.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion") +endif() + + add_definitions(-DTEST_GLOBALS=1) add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkData.cpp ${CMAKE_SOURCE_DIR}/src/StringUtils.cpp) -- cgit v1.2.3 From 95b81b3ef1885f822907ae3f3999ef1cf543e105 Mon Sep 17 00:00:00 2001 From: tycho Date: Sun, 24 May 2015 14:16:05 +0100 Subject: Disable -Werror for warnings in tests. --- tests/ChunkData/CMakeLists.txt | 3 +-- tests/ChunkData/Coordinates.cpp | 12 +----------- 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'tests/ChunkData') diff --git a/tests/ChunkData/CMakeLists.txt b/tests/ChunkData/CMakeLists.txt index 4079b7d93..bd2d6d9b4 100644 --- a/tests/ChunkData/CMakeLists.txt +++ b/tests/ChunkData/CMakeLists.txt @@ -3,9 +3,8 @@ cmake_minimum_required (VERSION 2.6) enable_testing() include_directories(${CMAKE_SOURCE_DIR}/src/) - - if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_flags_cxx("-Wno-error=old-style-cast") set_source_files_properties(${CMAKE_SOURCE_DIR}/src/ChunkData.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion") set_source_files_properties(${CMAKE_SOURCE_DIR}/src/StringUtils.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion") endif() diff --git a/tests/ChunkData/Coordinates.cpp b/tests/ChunkData/Coordinates.cpp index b3c66dde5..de6686243 100644 --- a/tests/ChunkData/Coordinates.cpp +++ b/tests/ChunkData/Coordinates.cpp @@ -8,7 +8,7 @@ int main(int argc, char** argv) { class cMockAllocationPool : public cAllocationPool - { + { virtual cChunkData::sChunkSection * Allocate() { return new cChunkData::sChunkSection(); @@ -138,17 +138,7 @@ int main(int argc, char** argv) cChunkData buffer(Pool); buffer.SetBlock(0, 0, 0, 0x42); cChunkData copy(Pool); - #if __cplusplus < 201103L - copy = buffer; - #else copy = std::move(buffer); - #endif - testassert(copy.GetBlock(0, 0, 0) == 0x42); - #if __cplusplus < 201103L - copy = copy; - #else - copy = std::move(copy); - #endif testassert(copy.GetBlock(0, 0, 0) == 0x42); } -- cgit v1.2.3