Changeset View
Changeset View
Standalone View
Standalone View
autotests/testcreateddatecompat.cpp
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 46 | = "BEGIN:VCALENDAR\n" | |||
---|---|---|---|---|---|
58 | "DTSTART:20031213T071500Z\n" | 58 | "DTSTART:20031213T071500Z\n" | ||
59 | "END:VEVENT\n" | 59 | "END:VEVENT\n" | ||
60 | "END:VCALENDAR\n"; | 60 | "END:VCALENDAR\n"; | ||
61 | 61 | | |||
62 | void CreatedDateCompatTest::testCompat32() | 62 | void CreatedDateCompatTest::testCompat32() | ||
63 | { | 63 | { | ||
64 | KCalCore::MemoryCalendar::Ptr cal(new KCalCore::MemoryCalendar(QTimeZone::utc())); | 64 | KCalCore::MemoryCalendar::Ptr cal(new KCalCore::MemoryCalendar(QTimeZone::utc())); | ||
65 | KCalCore::ICalFormat format; | 65 | KCalCore::ICalFormat format; | ||
66 | format.fromRawString(cal, QByteArray(icalFile32)); | 66 | QVERIFY(format.fromRawString(cal, QByteArray(icalFile32))); | ||
67 | KCalCore::Event::Ptr event = cal->event(QStringLiteral("uid")); | 67 | KCalCore::Event::Ptr event = cal->event(QStringLiteral("uid")); | ||
68 | QVERIFY(event); | 68 | QVERIFY(event); | ||
69 | QCOMPARE(event->created(), | 69 | QCOMPARE(event->created(), | ||
70 | QDateTime(QDate(2003, 12, 13), QTime(20, 47, 53), Qt::UTC)); | 70 | QDateTime(QDate(2003, 12, 13), QTime(20, 47, 53), Qt::UTC)); | ||
71 | } | 71 | } | ||
72 | 72 | | |||
73 | void CreatedDateCompatTest::testCompat33() | 73 | void CreatedDateCompatTest::testCompat33() | ||
74 | { | 74 | { | ||
75 | KCalCore::MemoryCalendar::Ptr cal(new KCalCore::MemoryCalendar(QTimeZone::utc())); | 75 | KCalCore::MemoryCalendar::Ptr cal(new KCalCore::MemoryCalendar(QTimeZone::utc())); | ||
76 | KCalCore::ICalFormat format; | 76 | KCalCore::ICalFormat format; | ||
77 | format.fromRawString(cal, QByteArray(icalFile33)); | 77 | QVERIFY(format.fromRawString(cal, QByteArray(icalFile33))); | ||
78 | KCalCore::Event::Ptr event = cal->event(QStringLiteral("uid")); | 78 | KCalCore::Event::Ptr event = cal->event(QStringLiteral("uid")); | ||
79 | QVERIFY(event); | 79 | QVERIFY(event); | ||
80 | QCOMPARE(event->created(), | 80 | QCOMPARE(event->created(), | ||
81 | QDateTime(QDate(2003, 12, 13), QTime(20, 41, 52), Qt::UTC)); | 81 | QDateTime(QDate(2003, 12, 13), QTime(20, 41, 52), Qt::UTC)); | ||
82 | QVERIFY(!event->customProperties().contains("X-KDE-ICAL-IMPLEMENTATION-VERSION")); | 82 | QVERIFY(!event->customProperties().contains("X-KDE-ICAL-IMPLEMENTATION-VERSION")); | ||
83 | } | 83 | } | ||
84 | 84 | | |||
85 | QTEST_MAIN(CreatedDateCompatTest) | 85 | QTEST_MAIN(CreatedDateCompatTest) |