summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
index 68887e38..83eb24a3 100644
--- a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
+++ b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
@@ -414,6 +414,7 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscovery()
}
// All returned QBluetoothServiceInfo should be valid.
+ bool servicesFound = !discoveredSpy.isEmpty();
while (!discoveredSpy.isEmpty()) {
const QVariant v = discoveredSpy.takeFirst().at(0);
// Work around limitation in QMetaType and moc.
@@ -442,7 +443,8 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscovery()
}
- QVERIFY(discoveryAgent.discoveredServices().count() != 0);
+ if (servicesFound)
+ QVERIFY(discoveryAgent.discoveredServices().count() != 0);
discoveryAgent.clear();
QVERIFY(discoveryAgent.discoveredServices().count() == 0);