Changeset View
Changeset View
Standalone View
Standalone View
autotests/kservicetest.cpp
Show All 23 Lines | |||||
24 | 24 | | |||
25 | #include <qtest.h> | 25 | #include <qtest.h> | ||
26 | 26 | | |||
27 | #include <kconfig.h> | 27 | #include <kconfig.h> | ||
28 | #include <kconfiggroup.h> | 28 | #include <kconfiggroup.h> | ||
29 | #include <kdesktopfile.h> | 29 | #include <kdesktopfile.h> | ||
30 | #include <ksycoca.h> | 30 | #include <ksycoca.h> | ||
31 | #include <kbuildsycoca_p.h> | 31 | #include <kbuildsycoca_p.h> | ||
32 | #include <../src/services/kserviceutil_p.h> | 32 | #include <../src/services/kserviceutil_p.h> // for KServiceUtilPrivate | ||
33 | #include <../src/services/ktraderparsetree_p.h> | 33 | #include <kapplicationtrader.h> | ||
34 | 34 | | |||
35 | #include <kservicegroup.h> | 35 | #include <kservicegroup.h> | ||
36 | #include <kservicetypetrader.h> | 36 | #include <kservicetypetrader.h> | ||
37 | #include <kservicetype.h> | 37 | #include <kservicetype.h> | ||
38 | #include <kservicetypeprofile.h> | 38 | #include <kservicetypeprofile.h> | ||
39 | #include <kpluginmetadata.h> | 39 | #include <kpluginmetadata.h> | ||
40 | #include <kplugininfo.h> | 40 | #include <kplugininfo.h> | ||
41 | 41 | | |||
▲ Show 20 Lines • Show All 554 Lines • ▼ Show 20 Line(s) | 545 | { | |||
596 | // A test with an invalid query, to test for memleaks | 596 | // A test with an invalid query, to test for memleaks | ||
597 | offers = KServiceTypeTrader::self()->query(QStringLiteral("FakePluginType"), QStringLiteral("A == B OR C == D AND OR Foo == 'Parse Error'")); | 597 | offers = KServiceTypeTrader::self()->query(QStringLiteral("FakePluginType"), QStringLiteral("A == B OR C == D AND OR Foo == 'Parse Error'")); | ||
598 | QVERIFY(offers.isEmpty()); | 598 | QVERIFY(offers.isEmpty()); | ||
599 | } | 599 | } | ||
600 | 600 | | |||
601 | void KServiceTest::testSubseqConstraints() | 601 | void KServiceTest::testSubseqConstraints() | ||
602 | { | 602 | { | ||
603 | auto test = [](const char* pattern, const char* text, bool sensitive) { | 603 | auto test = [](const char* pattern, const char* text, bool sensitive) { | ||
604 | return KTraderParse::ParseTreeSubsequenceMATCH::isSubseq( | 604 | return KApplicationTrader::isSubsequence( | ||
605 | QString(pattern), | 605 | QString(pattern), | ||
606 | QString(text), | 606 | QString(text), | ||
607 | sensitive? Qt::CaseSensitive : Qt::CaseInsensitive | 607 | sensitive? Qt::CaseSensitive : Qt::CaseInsensitive | ||
608 | ); | 608 | ); | ||
609 | }; | 609 | }; | ||
610 | 610 | | |||
611 | // Case Sensitive | 611 | // Case Sensitive | ||
612 | QVERIFY2(!test("", "", 1), "both empty"); | 612 | QVERIFY2(!test("", "", 1), "both empty"); | ||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |