1
0

Added schematic string serializer self-test.

This commit is contained in:
madmaxoft 2014-04-02 11:56:27 +02:00
parent 3301c5be1f
commit bcd7f9669b

View File

@ -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) bool cSchematicFileSerializer::LoadFromSchematicFile(cBlockArea & a_BlockArea, const AString & a_FileName)
{ {
// Un-GZip the contents: // Un-GZip the contents: