Fix device lookup on the tests

This commit is contained in:
Aleix Pol 2015-09-08 20:11:52 +02:00
parent a0da8ba858
commit acdd96c431
2 changed files with 12 additions and 2 deletions

View file

@ -75,7 +75,12 @@ class PluginLoadTest : public QObject
private Q_SLOTS:
void testPlugins() {
Device* d = mDaemon->devicesList().first();
Device* d = nullptr;
foreach(Device* id, mDaemon->devicesList()) {
if (id->isReachable())
d = id;
}
QVERIFY(d);
QVERIFY(d->isPaired());
QVERIFY(d->isReachable());

View file

@ -72,7 +72,12 @@ class TestSendFile : public QObject
private Q_SLOTS:
void testSend() {
Device* d = mDaemon->devicesList().first();
Device* d = nullptr;
foreach(Device* id, mDaemon->devicesList()) {
if (id->isReachable())
d = id;
}
QVERIFY(d);
QCOMPARE(d->isReachable(), true);
QCOMPARE(d->isPaired(), true);