2016-03-13 14:13:17 -04:00
|
|
|
|
|
|
|
// SchematicFileSerializerTest.cpp
|
|
|
|
|
|
|
|
// Implements the SchematicFileSerializer test main entrypoint
|
|
|
|
|
|
|
|
#include "Globals.h"
|
2019-08-26 15:38:34 -04:00
|
|
|
#include "../TestHelpers.h"
|
2016-03-13 14:13:17 -04:00
|
|
|
#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;
|
2019-08-26 15:38:34 -04:00
|
|
|
TEST_TRUE(cSchematicFileSerializer::SaveToSchematicString(ba, Schematic));
|
2016-03-13 14:13:17 -04:00
|
|
|
cBlockArea ba2;
|
2019-08-26 15:38:34 -04:00
|
|
|
TEST_TRUE(cSchematicFileSerializer::LoadFromSchematicString(ba2, Schematic));
|
2016-03-13 14:13:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-26 15:38:34 -04:00
|
|
|
IMPLEMENT_TEST_MAIN("SchematicFileSerializer",
|
2016-03-13 14:13:17 -04:00
|
|
|
DoTest();
|
2019-08-26 15:38:34 -04:00
|
|
|
)
|