diff --git a/autotests/testlog.cpp b/autotests/testlog.cpp --- a/autotests/testlog.cpp +++ b/autotests/testlog.cpp @@ -38,6 +38,7 @@ void init(); void initTestCase(); void cleanupTestCase(); + void testContext(); void testEnabled(); void testLogFile(); void testLog(); @@ -63,7 +64,17 @@ { qunsetenv(KSCREEN_LOGGING); qunsetenv(KSCREEN_LOGFILE); +} + +void TestLog::testContext() +{ + auto log = new KScreen::Log; + QString ctx("context text"); + QVERIFY(log != nullptr); + log->setContext(ctx); + QCOMPARE(log->context(), ctx); + delete log; } void TestLog::testEnabled() @@ -114,6 +125,10 @@ QVERIFY(lf.exists()); + // TODO read log and match logmsg + + QVERIFY(lf.remove()); + }