1
0

Disable -Werror for warnings in tests.

This commit is contained in:
tycho 2015-05-24 14:16:05 +01:00
parent 7a8025eacd
commit 95b81b3ef1
5 changed files with 7 additions and 16 deletions

View File

@ -155,11 +155,13 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set_source_files_properties(BiomeDef.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum")
set_source_files_properties(BlockArea.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion")
set_source_files_properties(BlockID.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors")
set_source_files_properties(ByteBuffer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=old-style-cast")
set_source_files_properties(BoundingBox.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors -Wno-error=float-equal")
set_source_files_properties(ByteBuffer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=old-style-cast -Wno-error=global-constructors")
set_source_files_properties(Chunk.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
set_source_files_properties(ChunkData.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=old-style-cast")
set_source_files_properties(ChunkMap.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=shadow -Wno-error=sign-conversion -Wno-error=old-style-cast")
set_source_files_properties(ClientHandle.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion -Wno-error=sign-conversion -Wno-error=global-constructors -Wno-error=old-style-cast")
set_source_files_properties(CompositeChat.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=global-constructors -Wno-error=missing-variable-declarations")
set_source_files_properties(Enchantments.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
set_source_files_properties(IniFile.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=old-style-cast")
set_source_files_properties(Inventory.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=conversion")

View File

@ -34,7 +34,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set_source_files_properties(FireworksSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum -Wno-error=old-style-cast")
set_source_files_properties(MapSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
set_source_files_properties(NBTChunkSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum -Wno-error=sign-conversion -Wno-error=conversion -Wno-error=old-style-cast")
set_source_files_properties(SchematicFileSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=shadow -Wno-error=conversion -Wno-error=old-style-cast")
set_source_files_properties(SchematicFileSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=shadow -Wno-error=conversion -Wno-error=old-style-cast -Wno-error=global-constructors")
set_source_files_properties(ScoreboardSerializer.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")
set_source_files_properties(WSSAnvil.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=shorten-64-to-32 -Wno-error=switch -Wno-error=switch-enum -Wno-error=conversion -Wno-error=old-style-cast")
set_source_files_properties(WorldStorage.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=old-style-cast")

View File

@ -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()

View File

@ -8,7 +8,7 @@ int main(int argc, char** argv)
{
class cMockAllocationPool
: public cAllocationPool<cChunkData::sChunkSection>
{
{
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);
}

View File

@ -42,7 +42,7 @@ if (MSVC)
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_flags_cxx("-Wno-error=conversion")
add_flags_cxx("-Wno-error=conversion -Wno-error=old-style-cast -Wno-error=inconsistent-missing-override")
endif()
# Define individual tests: