Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UAV_TEST(TestAProjectSerializeDeserialize)
- {
- AProject * bonch;
- bonch = new AProject("TestProject", "C:/test");
- AProject * bonch2;
- bonch2 = new AProject("TestProject", "C:/test");
- xmlDocPtr doc1 = xmlNewDoc(BAD_CAST XML_DEFAULT_VERSION);
- xmlNodePtr rootnode = xmlNewNode(NULL, BAD_CAST "at_project");
- xmlNodeSetContent(rootnode, BAD_CAST "");
- xmlDocSetRootElement(doc1, rootnode);
- bonch->serialize(rootnode);
- bonch->deserialize(rootnode);
- /*
- if (*bonch == *bonch2) {
- std::cout << "Test Passed" << std::endl;
- }
- */
- test_check_eq("Cant serialize/deserialize", *bonch, *bonch2);
- }
- UAV_TEST(SaveLoadEDFDDoc)
- {
- EDFDDocument * sqwonch = new EDFDDocument();
- sqwonch->saveToFile("C:/test2");
- EDFDDocument * sqwonch2 = new EDFDDocument();
- sqwonch2->loadFromFile("C:/test2");
- test_check_eq("test2", *sqwonch, *sqwonch2);
- }
- UAV_TEST(SaveLoadEDFDDocWithDetails)
- {
- EDFDDocument * sqwonch = new EDFDDocument();
- EDFDDocument * sqwonch2 = new EDFDDocument();
- DFDElement * new_el(nullptr);
- new_el = new DFDEntity();
- new_el->SetComment("1");
- new_el->mDetalization.used = false;
- shared_ptr<DFDElement> el(new_el);
- std::vector<std::shared_ptr<DFDElement>> els = (sqwonch->elements());
- els.push_back(el);
- new_el = new DFDEntity();
- new_el->SetComment("1");
- new_el->mDetalization.used = false;
- shared_ptr<DFDElement> el2(new_el);
- els = (sqwonch2->elements());
- els.push_back(el2);
- sqwonch->saveToFile("C:/lol");
- sqwonch->loadFromFile("C:/lol");
- test_check_eq("Raz", *sqwonch, *sqwonch2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement