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> | | |||
34 | 33 | | |||
35 | #include <kservicegroup.h> | 34 | #include <kservicegroup.h> | ||
36 | #include <kservicetypetrader.h> | 35 | #include <kservicetypetrader.h> | ||
37 | #include <kservicetype.h> | 36 | #include <kservicetype.h> | ||
38 | #include <kservicetypeprofile.h> | 37 | #include <kservicetypeprofile.h> | ||
39 | #include <kpluginmetadata.h> | 38 | #include <kpluginmetadata.h> | ||
40 | #include <kplugininfo.h> | 39 | #include <kplugininfo.h> | ||
41 | 40 | | |||
▲ Show 20 Lines • Show All 554 Lines • ▼ Show 20 Line(s) | 544 | { | |||
596 | // A test with an invalid query, to test for memleaks | 595 | // 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'")); | 596 | offers = KServiceTypeTrader::self()->query(QStringLiteral("FakePluginType"), QStringLiteral("A == B OR C == D AND OR Foo == 'Parse Error'")); | ||
598 | QVERIFY(offers.isEmpty()); | 597 | QVERIFY(offers.isEmpty()); | ||
599 | } | 598 | } | ||
600 | 599 | | |||
601 | void KServiceTest::testSubseqConstraints() | 600 | void KServiceTest::testSubseqConstraints() | ||
602 | { | 601 | { | ||
603 | auto test = [](const char* pattern, const char* text, bool sensitive) { | 602 | auto test = [](const char* pattern, const char* text, bool sensitive) { | ||
604 | return KTraderParse::ParseTreeSubsequenceMATCH::isSubseq( | 603 | return KService::isSubseq( | ||
605 | QString(pattern), | 604 | QString(pattern), | ||
606 | QString(text), | 605 | QString(text), | ||
607 | sensitive? Qt::CaseSensitive : Qt::CaseInsensitive | 606 | sensitive? Qt::CaseSensitive : Qt::CaseInsensitive | ||
608 | ); | 607 | ); | ||
609 | }; | 608 | }; | ||
610 | 609 | | |||
611 | // Case Sensitive | 610 | // Case Sensitive | ||
612 | QVERIFY2(!test("", "", 1), "both empty"); | 611 | QVERIFY2(!test("", "", 1), "both empty"); | ||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |