summaryrefslogtreecommitdiffstats
path: root/tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-03-13 19:13:17 +0100
committerMattes D <github@xoft.cz>2016-06-18 13:12:08 +0200
commita781be545611ac6dd4aa61433b77fbe4f2aeddad (patch)
tree8f45d5c9296729c4e26848ad4c6d23ad62e42862 /tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp
parentSelfTests: Moved cCompositeChat test to a separate project. (diff)
downloadcuberite-a781be545611ac6dd4aa61433b77fbe4f2aeddad.tar
cuberite-a781be545611ac6dd4aa61433b77fbe4f2aeddad.tar.gz
cuberite-a781be545611ac6dd4aa61433b77fbe4f2aeddad.tar.bz2
cuberite-a781be545611ac6dd4aa61433b77fbe4f2aeddad.tar.lz
cuberite-a781be545611ac6dd4aa61433b77fbe4f2aeddad.tar.xz
cuberite-a781be545611ac6dd4aa61433b77fbe4f2aeddad.tar.zst
cuberite-a781be545611ac6dd4aa61433b77fbe4f2aeddad.zip
Diffstat (limited to '')
-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;
+}
+
+
+
+