Commit 959df5c1 authored by David Jarvie's avatar David Jarvie
Browse files

Add more tests

parent 73b02f42
......@@ -2153,19 +2153,23 @@ void KADateTimeTest::addMSecs()
QVERIFY(utc2.isUtc());
QCOMPARE(utc2.date(), QDate(2005, 7, 6));
QCOMPARE(utc2.time(), QTime(23, 59, 59, 999));
QCOMPARE(utc1.msecsTo(utc2), 59899);
utc2 = utc1.addMSecs(59900);
QVERIFY(utc2.isUtc());
QCOMPARE(utc2.date(), QDate(2005, 7, 7));
QCOMPARE(utc2.time(), QTime(0, 0, 0, 0));
QCOMPARE(utc1.msecsTo(utc2), 59900);
KADateTime utc1a(QDate(2005, 7, 6), QTime(0, 0, 5, 100), KADateTime::UTC);
utc2 = utc1a.addMSecs(-5100);
QVERIFY(utc2.isUtc());
QCOMPARE(utc2.date(), QDate(2005, 7, 6));
QCOMPARE(utc2.time(), QTime(0, 0, 0, 0));
QCOMPARE(utc1a.msecsTo(utc2), -5100);
utc2 = utc1a.addMSecs(-5101);
QVERIFY(utc2.isUtc());
QCOMPARE(utc2.date(), QDate(2005, 7, 5));
QCOMPARE(utc2.time(), QTime(23, 59, 59, 999));
QCOMPARE(utc1a.msecsTo(utc2), -5101);
// UTC offset
KADateTime offset1(QDate(2005, 7, 6), QTime(3, 40, 0, 100), KADateTime::Spec::OffsetFromUTC(-5400)); // -0130
......
......@@ -1690,7 +1690,7 @@ KAEvent::Flags KAEvent::flags() const
KAEvent::Flags KAEventPrivate::flags() const
{
KAEvent::Flags result({});
KAEvent::Flags result{};
if (mBeep) {
result |= KAEvent::BEEP;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment