From 616ddf5ca50450279198775a598796bb367cf8ce Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 3 May 2014 06:02:51 -0700 Subject: [PATCH] cCHunkBuffer that compiles with TestGlobals.h --- src/BiomeDef.h | 2 +- src/ChunkBuffer.h | 7 +++++++ src/StringUtils.h | 3 +++ src/Vector3.h | 2 ++ tests/CMakeLists.txt | 2 ++ tests/ChunkBuffer/CMakeLists.txt | 6 ++++++ tests/ChunkBuffer/creatable.cpp | 7 ++++++- 7 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/BiomeDef.h b/src/BiomeDef.h index 67916890d..f929596e9 100644 --- a/src/BiomeDef.h +++ b/src/BiomeDef.h @@ -10,7 +10,7 @@ #pragma once - +#include "StringUtils.h" // tolua_begin diff --git a/src/ChunkBuffer.h b/src/ChunkBuffer.h index c23f8971d..410532232 100644 --- a/src/ChunkBuffer.h +++ b/src/ChunkBuffer.h @@ -1,6 +1,13 @@ #pragma once + +#include + + +#include "ChunkDef.h" + + #define CHUNK_SECTION_HEIGHT 16 #define CHUNK_SECTION_NUM (256 / CHUNK_SECTION_HEIGHT) diff --git a/src/StringUtils.h b/src/StringUtils.h index b69e47d3c..347fbe909 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -11,6 +11,9 @@ +#include + + typedef std::string AString; diff --git a/src/Vector3.h b/src/Vector3.h index 2c79f9ff1..53fdcf6df 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -5,6 +5,8 @@ #define _USE_MATH_DEFINES // Enable non-standard math defines (MSVC) #include +#include +#include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c2f9ceb5a..1e3a01dc8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,4 +2,6 @@ cmake_minimum_required (VERSION 2.6) enable_testing() +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + add_subdirectory(ChunkBuffer) diff --git a/tests/ChunkBuffer/CMakeLists.txt b/tests/ChunkBuffer/CMakeLists.txt index 33722f785..08d01d1a0 100644 --- a/tests/ChunkBuffer/CMakeLists.txt +++ b/tests/ChunkBuffer/CMakeLists.txt @@ -2,9 +2,15 @@ cmake_minimum_required (VERSION 2.6) enable_testing() +include_directories(${CMAKE_SOURCE_DIR}/src/) + add_library(ChunkBuffer ${CMAKE_SOURCE_DIR}/src/ChunkBuffer.cpp) add_executable(creatable-exe creatable.cpp) target_link_libraries(creatable-exe ChunkBuffer) add_test(NAME creatable-test COMMAND creatable-exe) + +add_executable(coordinates-exe Coordinates.cpp) +target_link_libraries(coordinates-exe ChunkBuffer) +add_test(NAME coordinates-test COMMAND coordinates-exe) diff --git a/tests/ChunkBuffer/creatable.cpp b/tests/ChunkBuffer/creatable.cpp index 573f09de9..49204c879 100644 --- a/tests/ChunkBuffer/creatable.cpp +++ b/tests/ChunkBuffer/creatable.cpp @@ -1,4 +1,9 @@ + +#include "TestGlobals.h" +#include "ChunkBuffer.h" + int main(int argc, char** argv) { -return 0; + cChunkBuffer buffer; + return 0; }