File indexing completed on 2024-11-24 04:44:10
0001 /* 0002 * SPDX-FileCopyrightText: 2012 Christian Mollekopf <mollekopf@kolabsys.com> 0003 * 0004 * SPDX-License-Identifier: LGPL-3.0-or-later 0005 */ 0006 0007 #include "xmlobjecttest.h" 0008 0009 #include <QTest> 0010 #include <iostream> 0011 0012 #include "kolabformat/xmlobject.h" 0013 0014 void XMLObjectTest::testEvent() 0015 { 0016 Kolab::Event event; 0017 event.setStart(Kolab::cDateTime(2012, 01, 01)); 0018 0019 Kolab::XMLObject xmlobject; 0020 const std::string output = xmlobject.writeEvent(event, Kolab::KolabV2, "productid"); 0021 QVERIFY(!output.empty()); 0022 std::cout << output; 0023 0024 const Kolab::Event resultEvent = xmlobject.readEvent(output, Kolab::KolabV2); 0025 QVERIFY(resultEvent.isValid()); 0026 } 0027 0028 void XMLObjectTest::testDontCrash() 0029 { 0030 Kolab::XMLObject ob; 0031 ob.writeEvent(Kolab::Event(), Kolab::KolabV2, ""); 0032 ob.writeTodo(Kolab::Todo(), Kolab::KolabV2, ""); 0033 ob.writeJournal(Kolab::Journal(), Kolab::KolabV2, ""); 0034 ob.writeFreebusy(Kolab::Freebusy(), Kolab::KolabV2, ""); 0035 ob.writeContact(Kolab::Contact(), Kolab::KolabV2, ""); 0036 ob.writeDistlist(Kolab::DistList(), Kolab::KolabV2, ""); 0037 ob.writeNote(Kolab::Note(), Kolab::KolabV2, ""); 0038 ob.writeConfiguration(Kolab::Configuration(), Kolab::KolabV2, ""); 0039 0040 ob.readEvent("", Kolab::KolabV2); 0041 ob.readTodo("", Kolab::KolabV2); 0042 ob.readJournal("", Kolab::KolabV2); 0043 ob.readFreebusy("", Kolab::KolabV2); 0044 ob.readContact("", Kolab::KolabV2); 0045 ob.readDistlist("", Kolab::KolabV2); 0046 ob.readNote("", Kolab::KolabV2); 0047 ob.readConfiguration("", Kolab::KolabV2); 0048 } 0049 0050 QTEST_MAIN(XMLObjectTest) 0051 0052 #include "moc_xmlobjecttest.cpp"