mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-14 12:18:22 +00:00
Update SavingTests.cpp
This commit is contained in:
parent
bd0cafa33f
commit
8685d0dbdc
@ -2,6 +2,7 @@
|
|||||||
#include "Character.h"
|
#include "Character.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "tinyxml2.h"
|
#include "tinyxml2.h"
|
||||||
|
#include "BuffComponent.h"
|
||||||
|
|
||||||
class SavingTest : public GameDependenciesTest {
|
class SavingTest : public GameDependenciesTest {
|
||||||
protected:
|
protected:
|
||||||
@ -23,6 +24,7 @@ protected:
|
|||||||
character->_setXmlData(printer.CStr());
|
character->_setXmlData(printer.CStr());
|
||||||
doc.Clear();
|
doc.Clear();
|
||||||
character->_doQuickXMLDataParse();
|
character->_doQuickXMLDataParse();
|
||||||
|
entity->AddComponent<BuffComponent>()->LoadFromXml(entity->GetCharacter()->GetXMLDoc());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TearDown() override {
|
void TearDown() override {
|
||||||
@ -41,9 +43,9 @@ TEST_F(SavingTest, EntityLevelTest) {
|
|||||||
doc.Print(&printer);
|
doc.Print(&printer);
|
||||||
std::string xmlDataModified(printer.CStr());
|
std::string xmlDataModified(printer.CStr());
|
||||||
doc.Clear();
|
doc.Clear();
|
||||||
std::ofstream oldXml("./test_xml_data_original.xml");
|
// std::ofstream oldXml("./test_xml_data_original.xml");
|
||||||
std::ofstream newXml("./test_xml_data_new.xml");
|
// std::ofstream newXml("./test_xml_data_new.xml");
|
||||||
oldXml << xmlDataOriginal;
|
// oldXml << xmlDataOriginal;
|
||||||
newXml << xmlDataModified;
|
// newXml << xmlDataModified;
|
||||||
LOG("Component count: %i Same: %i", entity->GetComponents().size(), xmlDataOriginal == xmlDataModified);
|
LOG("Component count: %i Same: %i", entity->GetComponents().size(), xmlDataOriginal == xmlDataModified);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user