diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-04-02 15:37:24 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-04-02 15:37:24 +0200 |
commit | 741a64c250a1085108f24f351e9d9dacd085cc82 (patch) | |
tree | a69b5aba676473e5f75822a02e14e2acc542b263 /src/WorldStorage | |
parent | Fixed All signedness warnings in HTTPServer.cpp (diff) | |
parent | Merge branch 'master' into globals (diff) | |
download | cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.gz cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.bz2 cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.lz cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.xz cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.zst cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.zip |
Diffstat (limited to 'src/WorldStorage')
-rw-r--r-- | src/WorldStorage/SchematicFileSerializer.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/WorldStorage/SchematicFileSerializer.cpp b/src/WorldStorage/SchematicFileSerializer.cpp index d8531d965..9d594a084 100644 --- a/src/WorldStorage/SchematicFileSerializer.cpp +++ b/src/WorldStorage/SchematicFileSerializer.cpp @@ -14,6 +14,39 @@ +#ifdef SELF_TEST + +static class cSchematicStringSelfTest +{ +public: + cSchematicStringSelfTest(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!"); + } + } +} g_SelfTest; + +#endif + + + + + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// cSchematicFileSerializer: + bool cSchematicFileSerializer::LoadFromSchematicFile(cBlockArea & a_BlockArea, const AString & a_FileName) { // Un-GZip the contents: |