Changeset View
Changeset View
Standalone View
Standalone View
autotests/testlog.cpp
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | |||||
50 | { | 50 | { | ||
51 | QStandardPaths::setTestModeEnabled(true); | 51 | QStandardPaths::setTestModeEnabled(true); | ||
52 | m_defaultLogFile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kscreen/kscreen.log"; | 52 | m_defaultLogFile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/kscreen/kscreen.log"; | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | void TestLog::initTestCase() | 55 | void TestLog::initTestCase() | ||
56 | { | 56 | { | ||
57 | 57 | | |||
58 | qputenv(KSCREEN_LOGGING, QByteArray("true")); | ||||
58 | } | 59 | } | ||
59 | 60 | | |||
60 | void TestLog::cleanupTestCase() | 61 | void TestLog::cleanupTestCase() | ||
61 | { | 62 | { | ||
62 | qunsetenv(KSCREEN_LOGGING); | 63 | qunsetenv(KSCREEN_LOGGING); | ||
63 | } | 64 | } | ||
64 | 65 | | |||
65 | void TestLog::testContext() | 66 | void TestLog::testContext() | ||
Show All 14 Lines | 78 | { | |||
80 | auto log = Log::instance(); | 81 | auto log = Log::instance(); | ||
81 | QCOMPARE(log->enabled(), false); | 82 | QCOMPARE(log->enabled(), false); | ||
82 | QCOMPARE(log->logFile(), QString()); | 83 | QCOMPARE(log->logFile(), QString()); | ||
83 | 84 | | |||
84 | delete log; | 85 | delete log; | ||
85 | qunsetenv(KSCREEN_LOGGING); | 86 | qunsetenv(KSCREEN_LOGGING); | ||
86 | 87 | | |||
87 | log = Log::instance(); | 88 | log = Log::instance(); | ||
89 | QCOMPARE(log->enabled(), false); | ||||
90 | QCOMPARE(log->logFile(), QString()); | ||||
91 | | ||||
92 | delete log; | ||||
93 | qputenv(KSCREEN_LOGGING, QByteArray("truE")); | ||||
graesslin: typo | |||||
94 | | ||||
95 | log = Log::instance(); | ||||
88 | QCOMPARE(log->enabled(), true); | 96 | QCOMPARE(log->enabled(), true); | ||
89 | QCOMPARE(log->logFile(), m_defaultLogFile); | 97 | QCOMPARE(log->logFile(), m_defaultLogFile); | ||
90 | 98 | | |||
91 | delete log; | 99 | delete log; | ||
92 | } | 100 | } | ||
93 | 101 | | |||
94 | void TestLog::testLog() | 102 | void TestLog::testLog() | ||
95 | { | 103 | { | ||
Show All 36 Lines |
typo