From fc074c8ec88f074c703b2572aa0ee67852848f6e Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 9 Sep 2015 20:12:05 +0200 Subject: [PATCH] Fix tests Ensure the loopback device is paired --- tests/pluginloadtest.cpp | 4 +++- tests/sendfiletest.cpp | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/pluginloadtest.cpp b/tests/pluginloadtest.cpp index 0453f6e62..a2a4bc87c 100644 --- a/tests/pluginloadtest.cpp +++ b/tests/pluginloadtest.cpp @@ -77,8 +77,10 @@ class PluginLoadTest : public QObject void testPlugins() { Device* d = nullptr; foreach(Device* id, mDaemon->devicesList()) { - if (id->isReachable()) + if (id->isReachable()) { + id->requestPair(); d = id; + } } QVERIFY(d); QVERIFY(d->isPaired()); diff --git a/tests/sendfiletest.cpp b/tests/sendfiletest.cpp index d9d6ab5c5..015818b36 100644 --- a/tests/sendfiletest.cpp +++ b/tests/sendfiletest.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -68,14 +69,18 @@ class TestSendFile : public QObject { Q_OBJECT public: - TestSendFile() : mDaemon(new TestDaemon) {} + TestSendFile() : mDaemon(new TestDaemon) { + QStandardPaths::setTestModeEnabled(true); + } private Q_SLOTS: void testSend() { Device* d = nullptr; foreach(Device* id, mDaemon->devicesList()) { - if (id->isReachable()) + if (id->isReachable()) { + id->requestPair(); d = id; + } } QVERIFY(d); QCOMPARE(d->isReachable(), true);