diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro | 1 | ||||
-rw-r--r-- | tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro b/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro index 2cc4a9e8..9ae5d71d 100644 --- a/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro +++ b/tests/auto/qbluetoothservicediscoveryagent/qbluetoothservicediscoveryagent.pro @@ -4,7 +4,6 @@ CONFIG += testcase QT = core concurrent bluetooth testlib osx:QT += widgets -osx:CONFIG += insignificant_test blackberry { LIBS += -lbtapi } diff --git a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp index f9e7ef1a..341c6918 100644 --- a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp +++ b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp @@ -84,6 +84,7 @@ tst_QBluetoothServiceDiscoveryAgent::tst_QBluetoothServiceDiscoveryAgent() QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true")); // start Bluetooth if not started +#ifndef Q_OS_OSX QBluetoothLocalDevice *device = new QBluetoothLocalDevice(); localDeviceAvailable = device->isValid(); if (localDeviceAvailable) { @@ -92,6 +93,10 @@ tst_QBluetoothServiceDiscoveryAgent::tst_QBluetoothServiceDiscoveryAgent() QTest::qWait(1000); } delete device; +#else + QBluetoothLocalDevice device; + localDeviceAvailable = QBluetoothLocalDevice().hostMode() != QBluetoothLocalDevice::HostPoweredOff; +#endif qRegisterMetaType<QBluetoothDeviceInfo>("QBluetoothDeviceInfo"); qRegisterMetaType<QBluetoothServiceInfo>("QBluetoothServiceInfo"); @@ -147,6 +152,10 @@ void tst_QBluetoothServiceDiscoveryAgent::initTestCase() void tst_QBluetoothServiceDiscoveryAgent::tst_invalidBtAddress() { +#ifdef Q_OS_OSX + if (!localDeviceAvailable) + QSKIP("On OS X this test requires Bluetooth adapter in powered ON state"); +#endif QBluetoothServiceDiscoveryAgent *discoveryAgent = new QBluetoothServiceDiscoveryAgent(QBluetoothAddress("11:11:11:11:11:11")); QCOMPARE(discoveryAgent->error(), QBluetoothServiceDiscoveryAgent::InvalidBluetoothAdapterError); |