summaryrefslogtreecommitdiffstats
path: root/tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-06-19 14:57:14 +0200
committerGitHub <noreply@github.com>2016-06-19 14:57:14 +0200
commit5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7 (patch)
tree083bbf9029b971dbf7b74353c9c62c22de9c78c7 /tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp
parentMerge pull request #3224 from QUSpilPrgm/master (diff)
parentcNetwork: Fixed possible hang when terminating immediately after init. (diff)
downloadcuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar
cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar.gz
cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar.bz2
cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar.lz
cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar.xz
cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.tar.zst
cuberite-5ee6643804aa9cf5bc2a98b983ef7c453e78b8c7.zip
Diffstat (limited to 'tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp')
-rw-r--r--tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp b/tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp
new file mode 100644
index 000000000..fc18daf93
--- /dev/null
+++ b/tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp
@@ -0,0 +1,43 @@
+
+// SchematicFileSerializerTest.cpp
+
+// Implements the SchematicFileSerializer test main entrypoint
+
+#include "Globals.h"
+#include "WorldStorage/SchematicFileSerializer.h"
+
+
+
+
+
+static void DoTest(void)
+{
+ cBlockArea ba;
+ ba.Create(21, 256, 21);
+ ba.RelLine(0, 0, 0, 9, 8, 7, cBlockArea::baTypes | cBlockArea::baMetas, E_BLOCK_WOODEN_STAIRS, 1);
+ AString Schematic;
+ if (!cSchematicFileSerializer::SaveToSchematicString(ba, Schematic))
+ {
+ assert_test(!"Schematic failed to save!");
+ }
+ cBlockArea ba2;
+ if (!cSchematicFileSerializer::LoadFromSchematicString(ba2, Schematic))
+ {
+ assert_test(!"Schematic failed to load!");
+ }
+}
+
+
+
+
+
+int main(int argc, char * argv[])
+{
+ DoTest();
+ LOG("SchematicFileSerializer test done.");
+ return 0;
+}
+
+
+
+