summaryrefslogtreecommitdiffstats
path: root/tests/ChunkBuffer
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ChunkBuffer')
-rw-r--r--tests/ChunkBuffer/CMakeLists.txt16
-rw-r--r--tests/ChunkBuffer/Coordinates.cpp15
-rw-r--r--tests/ChunkBuffer/creatable.cpp9
3 files changed, 40 insertions, 0 deletions
diff --git a/tests/ChunkBuffer/CMakeLists.txt b/tests/ChunkBuffer/CMakeLists.txt
new file mode 100644
index 000000000..08d01d1a0
--- /dev/null
+++ b/tests/ChunkBuffer/CMakeLists.txt
@@ -0,0 +1,16 @@
+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/Coordinates.cpp b/tests/ChunkBuffer/Coordinates.cpp
new file mode 100644
index 000000000..d61eda7ad
--- /dev/null
+++ b/tests/ChunkBuffer/Coordinates.cpp
@@ -0,0 +1,15 @@
+
+#include "TestGlobals.h"
+#include "ChunkBuffer.h"
+
+
+
+int main(int argc, char** argv)
+{
+ cChunkBuffer buffer;
+ buffer.SetBlock(0,0,0, 0xAB);
+ assert(buffer.GetBlock(0,0,0) == 0xAB);
+ buffer.SetMeta(0,16,0, 0xC);
+ assert(buffer.GetMeta(0,16,0) == 0xC);
+ return 0;
+}
diff --git a/tests/ChunkBuffer/creatable.cpp b/tests/ChunkBuffer/creatable.cpp
new file mode 100644
index 000000000..49204c879
--- /dev/null
+++ b/tests/ChunkBuffer/creatable.cpp
@@ -0,0 +1,9 @@
+
+#include "TestGlobals.h"
+#include "ChunkBuffer.h"
+
+int main(int argc, char** argv)
+{
+ cChunkBuffer buffer;
+ return 0;
+}