Changeset View
Changeset View
Standalone View
Standalone View
tests/calendaringtest.cpp
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | void CalendaringTest::testRecurrence() | ||||
rrule.setFrequency(Kolab::RecurrenceRule::Daily); | rrule.setFrequency(Kolab::RecurrenceRule::Daily); | ||||
rrule.setInterval(1); | rrule.setInterval(1); | ||||
rrule.setCount(10); | rrule.setCount(10); | ||||
event.setRecurrenceRule(rrule); | event.setRecurrenceRule(rrule); | ||||
Kolab::cDateTime previousDate = event.start(); | Kolab::cDateTime previousDate = event.start(); | ||||
for (int i = 0; i < 9; i++) { | for (int i = 0; i < 9; i++) { | ||||
const Kolab::cDateTime nextDate = event.getNextOccurence(previousDate); | const Kolab::cDateTime nextDate = event.getNextOccurence(previousDate); | ||||
qDebug() << QTest::toString(nextDate); | const char *nextDateString = QTest::toString(nextDate); | ||||
qDebug() << nextDateString; | |||||
delete[] nextDateString; | |||||
QCOMPARE(nextDate, Kolab::cDateTime("Europe/Zurich", previousDate.year(), previousDate.month(), previousDate.day()+1, previousDate.hour(), previousDate.minute(), previousDate.second())); | QCOMPARE(nextDate, Kolab::cDateTime("Europe/Zurich", previousDate.year(), previousDate.month(), previousDate.day()+1, previousDate.hour(), previousDate.minute(), previousDate.second())); | ||||
const Kolab::cDateTime endDate = event.getOccurenceEndDate(nextDate); | const Kolab::cDateTime endDate = event.getOccurenceEndDate(nextDate); | ||||
// qDebug() << QTest::toString(endDate); | // qDebug() << QTest::toString(endDate); | ||||
QCOMPARE(endDate, Kolab::cDateTime("Europe/Zurich", nextDate.year(), nextDate.month(), nextDate.day(), event.end().hour(), event.end().minute(), event.end().second())); | QCOMPARE(endDate, Kolab::cDateTime("Europe/Zurich", nextDate.year(), nextDate.month(), nextDate.day(), event.end().hour(), event.end().minute(), event.end().second())); | ||||
previousDate = nextDate; | previousDate = nextDate; | ||||
} | } | ||||
Kolab::cDateTime outOfScopeDate = event.getNextOccurence(previousDate); | Kolab::cDateTime outOfScopeDate = event.getNextOccurence(previousDate); | ||||
Show All 12 Lines |