From a781be545611ac6dd4aa61433b77fbe4f2aeddad Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 13 Mar 2016 19:13:17 +0100 Subject: SelfTests: Moved SchematicFileSerializer test into a separate project. --- .../SchematicFileSerializerTest.cpp | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp (limited to 'tests/SchematicFileSerializer/SchematicFileSerializerTest.cpp') 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; +} + + + + -- cgit v1.2.3