Fix tests

Ensure the loopback device is paired
This commit is contained in:
Aleix Pol 2015-09-09 20:12:05 +02:00
parent a9d2840664
commit fc074c8ec8
2 changed files with 10 additions and 3 deletions

View file

@ -77,9 +77,11 @@ 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());
QVERIFY(d->isReachable());

View file

@ -24,6 +24,7 @@
#include <QTest>
#include <QTemporaryFile>
#include <QSignalSpy>
#include <QStandardPaths>
#include <KIO/AccessManager>
@ -68,15 +69,19 @@ 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);
QCOMPARE(d->isPaired(), true);