Changeset View
Changeset View
Standalone View
Standalone View
autotests/test_builtin_effectloader.cpp
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Line(s) | 138 | expectedEffects << QStringLiteral("blur") | |||
---|---|---|---|---|---|
171 | << QStringLiteral("trackmouse") | 171 | << QStringLiteral("trackmouse") | ||
172 | << QStringLiteral("windowgeometry") | 172 | << QStringLiteral("windowgeometry") | ||
173 | << QStringLiteral("wobblywindows") | 173 | << QStringLiteral("wobblywindows") | ||
174 | << QStringLiteral("zoom"); | 174 | << QStringLiteral("zoom"); | ||
175 | 175 | | |||
176 | KWin::BuiltInEffectLoader loader; | 176 | KWin::BuiltInEffectLoader loader; | ||
177 | QStringList result = loader.listOfKnownEffects(); | 177 | QStringList result = loader.listOfKnownEffects(); | ||
178 | QCOMPARE(result.size(), expectedEffects.size()); | 178 | QCOMPARE(result.size(), expectedEffects.size()); | ||
179 | qSort(result); | 179 | std::sort(result.begin(), result.end()); | ||
180 | for (int i = 0; i < expectedEffects.size(); ++i) { | 180 | for (int i = 0; i < expectedEffects.size(); ++i) { | ||
181 | QCOMPARE(result.at(i), expectedEffects.at(i)); | 181 | QCOMPARE(result.at(i), expectedEffects.at(i)); | ||
182 | } | 182 | } | ||
183 | } | 183 | } | ||
184 | 184 | | |||
185 | void TestBuiltInEffectLoader::testSupported_data() | 185 | void TestBuiltInEffectLoader::testSupported_data() | ||
186 | { | 186 | { | ||
187 | QTest::addColumn<QString>("name"); | 187 | QTest::addColumn<QString>("name"); | ||
▲ Show 20 Lines • Show All 364 Lines • ▼ Show 20 Line(s) | 489 | { | |||
552 | // let's use qWait as we need to wait for two signals to be emitted | 552 | // let's use qWait as we need to wait for two signals to be emitted | ||
553 | QTest::qWait(100); | 553 | QTest::qWait(100); | ||
554 | QCOMPARE(spy.size(), 2); | 554 | QCOMPARE(spy.size(), 2); | ||
555 | QStringList loadedEffects; | 555 | QStringList loadedEffects; | ||
556 | for (auto &list : spy) { | 556 | for (auto &list : spy) { | ||
557 | QCOMPARE(list.size(), 2); | 557 | QCOMPARE(list.size(), 2); | ||
558 | loadedEffects << list.at(1).toString(); | 558 | loadedEffects << list.at(1).toString(); | ||
559 | } | 559 | } | ||
560 | qSort(loadedEffects); | 560 | std::sort(loadedEffects.begin(), loadedEffects.end()); | ||
561 | QCOMPARE(loadedEffects.at(0), QStringLiteral("kscreen")); | 561 | QCOMPARE(loadedEffects.at(0), QStringLiteral("kscreen")); | ||
562 | QCOMPARE(loadedEffects.at(1), QStringLiteral("mouseclick")); | 562 | QCOMPARE(loadedEffects.at(1), QStringLiteral("mouseclick")); | ||
563 | } | 563 | } | ||
564 | 564 | | |||
565 | Q_CONSTRUCTOR_FUNCTION(forceXcb) | 565 | Q_CONSTRUCTOR_FUNCTION(forceXcb) | ||
566 | QTEST_MAIN(TestBuiltInEffectLoader) | 566 | QTEST_MAIN(TestBuiltInEffectLoader) | ||
567 | #include "test_builtin_effectloader.moc" | 567 | #include "test_builtin_effectloader.moc" |