diff --git a/tests/pluginloadtest.cpp b/tests/pluginloadtest.cpp index dfa04accf..cc05fdf84 100644 --- a/tests/pluginloadtest.cpp +++ b/tests/pluginloadtest.cpp @@ -39,19 +39,24 @@ class PluginLoadTest : public QObject { Q_OBJECT public: - PluginLoadTest() : mDaemon(new TestDaemon) { + PluginLoadTest() { QStandardPaths::setTestModeEnabled(true); + mDaemon = new TestDaemon; } private Q_SLOTS: void testPlugins() { Device* d = nullptr; + mDaemon->acquireDiscoveryMode("plugintest"); foreach(Device* id, mDaemon->devicesList()) { if (id->isReachable()) { - id->requestPair(); + if (!id->isTrusted()) + id->requestPair(); d = id; + break; } } + mDaemon->releaseDiscoveryMode("plugintest"); if (!d->loadedPlugins().contains("kdeconnect_remotecontrol")) { QSKIP("kdeconnect_remotecontrol is required for this test"); diff --git a/tests/sendfiletest.cpp b/tests/sendfiletest.cpp index 667c86e76..f65e5bf7e 100644 --- a/tests/sendfiletest.cpp +++ b/tests/sendfiletest.cpp @@ -39,19 +39,23 @@ class TestSendFile : public QObject { Q_OBJECT public: - TestSendFile() : mDaemon(new TestDaemon) { + TestSendFile() { QStandardPaths::setTestModeEnabled(true); + mDaemon = new TestDaemon; } private Q_SLOTS: void testSend() { + mDaemon->acquireDiscoveryMode("test"); Device* d = nullptr; foreach(Device* id, mDaemon->devicesList()) { if (id->isReachable()) { - id->requestPair(); + if (!id->isTrusted()) + id->requestPair(); d = id; } } + mDaemon->releaseDiscoveryMode("test"); QVERIFY(d); QCOMPARE(d->isReachable(), true); QCOMPARE(d->isTrusted(), true);