Changeset View
Changeset View
Standalone View
Standalone View
resources/kolab/pimkolab/autotests/debugstreamtest.cpp
Show All 20 Lines | |||||
21 | 21 | | |||
22 | #include <QTest> | 22 | #include <QTest> | ||
23 | 23 | | |||
24 | void DebugStreamTest::testDebugstream() | 24 | void DebugStreamTest::testDebugstream() | ||
25 | { | 25 | { | ||
26 | Error() << "test1"; | 26 | Error() << "test1"; | ||
27 | Error() << "test2" << "bla" << 3 << QMap<QString, int>(); | 27 | Error() << "test2" << "bla" << 3 << QMap<QString, int>(); | ||
28 | QCOMPARE(Kolab::ErrorHandler::instance().getErrors().size(), 2); | 28 | QCOMPARE(Kolab::ErrorHandler::instance().getErrors().size(), 2); | ||
29 | QVERIFY(Kolab::ErrorHandler::instance().getErrors().first().message.contains("test1")); | 29 | QVERIFY(Kolab::ErrorHandler::instance().getErrors().first().message.contains(QLatin1String("test1"))); | ||
30 | QCOMPARE(Kolab::ErrorHandler::instance().getErrors().first().severity, Kolab::ErrorHandler::Error); | 30 | QCOMPARE(Kolab::ErrorHandler::instance().getErrors().first().severity, Kolab::ErrorHandler::Error); | ||
31 | QVERIFY(Kolab::ErrorHandler::instance().getErrors().last().message.contains("bla")); | 31 | QVERIFY(Kolab::ErrorHandler::instance().getErrors().last().message.contains(QLatin1String("bla"))); | ||
32 | } | 32 | } | ||
33 | 33 | | |||
34 | void DebugStreamTest::testDebugNotLogged() | 34 | void DebugStreamTest::testDebugNotLogged() | ||
35 | { | 35 | { | ||
36 | Kolab::ErrorHandler::instance().clear(); | 36 | Kolab::ErrorHandler::instance().clear(); | ||
37 | Debug() << "test1"; | 37 | Debug() << "test1"; | ||
38 | QCOMPARE(Kolab::ErrorHandler::instance().getErrors().size(), 0); | 38 | QCOMPARE(Kolab::ErrorHandler::instance().getErrors().size(), 0); | ||
39 | } | 39 | } | ||
Show All 14 Lines |