summaryrefslogtreecommitdiffstats
path: root/tests/auto/qlowenergycontroller
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2017-08-07 13:23:52 +0200
committerOliver Wolff <oliver.wolff@qt.io>2017-08-30 13:33:16 +0000
commitd7af5496668da92bfa48564053bfc039cef6ecea (patch)
tree558c8c0298332d5159d13c0b445443dc6c91778c /tests/auto/qlowenergycontroller
parent43a382c16d1c5c80e7a97577a6eb3511dff8c359 (diff)
winrt: Use config feature when checking for winrt backend in auto tests
As the winrt backend may also be used on desktop Windows, checking for the operating system does no longer work. While touching these lines deprecated OS X checks were fixed as well. Task-number: QTBUG-61566 Change-Id: I247979aa63de6a71ac4908bda946d7db1e29b6c3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'tests/auto/qlowenergycontroller')
-rw-r--r--tests/auto/qlowenergycontroller/qlowenergycontroller.pro2
-rw-r--r--tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp20
2 files changed, 12 insertions, 10 deletions
diff --git a/tests/auto/qlowenergycontroller/qlowenergycontroller.pro b/tests/auto/qlowenergycontroller/qlowenergycontroller.pro
index 24178b6e..7a67e8e4 100644
--- a/tests/auto/qlowenergycontroller/qlowenergycontroller.pro
+++ b/tests/auto/qlowenergycontroller/qlowenergycontroller.pro
@@ -1,4 +1,4 @@
-QT = core bluetooth testlib
+QT = core bluetooth-private testlib
# Android requires GUI application when running test
android: QT += widgets
diff --git a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp
index c6fd83e6..aa779f47 100644
--- a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp
+++ b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp
@@ -27,6 +27,8 @@
****************************************************************************/
#include <QtTest/QtTest>
+
+#include <private/qtbluetoothglobal_p.h>
#include <QBluetoothAddress>
#include <QBluetoothLocalDevice>
#include <QBluetoothDeviceDiscoveryAgent>
@@ -119,7 +121,7 @@ void tst_QLowEnergyController::initTestCase()
{
#if !defined(Q_OS_MAC)
if (remoteDevice.isNull()
-#ifndef Q_OS_WINRT
+#if !QT_CONFIG(winrt_bt)
|| QBluetoothLocalDevice::allDevices().isEmpty()) {
#else
) {
@@ -245,7 +247,7 @@ void tst_QLowEnergyController::tst_connect()
{
QList<QBluetoothHostInfo> localAdapters = QBluetoothLocalDevice::allDevices();
-#if defined(Q_OS_IOS) || defined(Q_OS_TVOS) || defined(Q_OS_WINRT)
+#if defined(Q_OS_IOS) || defined(Q_OS_TVOS) || QT_CONFIG(winrt_bt)
if (!remoteDeviceInfo.isValid())
#else
if (localAdapters.isEmpty() || !remoteDeviceInfo.isValid())
@@ -262,7 +264,7 @@ void tst_QLowEnergyController::tst_connect()
else
QCOMPARE(control.remoteName(), remoteDeviceInfo.name());
-#if !defined(Q_OS_IOS) && !defined(Q_OS_TVOS) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_IOS) && !defined(Q_OS_TVOS) && !QT_CONFIG(winrt_bt)
const QBluetoothAddress localAdapter = localAdapters.at(0).address();
QCOMPARE(control.localAddress(), localAdapter);
QVERIFY(!control.localAddress().isNull());
@@ -405,7 +407,7 @@ void tst_QLowEnergyController::tst_connect()
void tst_QLowEnergyController::tst_concurrentDiscovery()
{
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_MACOS) && !QT_CONFIG(winrt_bt)
QList<QBluetoothHostInfo> localAdapters = QBluetoothLocalDevice::allDevices();
if (localAdapters.isEmpty())
QSKIP("No local Bluetooth device found. Skipping test.");
@@ -442,7 +444,7 @@ void tst_QLowEnergyController::tst_concurrentDiscovery()
30000);
}
-#if defined(Q_OS_ANDROID) || defined(Q_OS_WINRT)
+#if defined(Q_OS_ANDROID) || QT_CONFIG(winrt_bt)
QCOMPARE(control.state(), QLowEnergyController::ConnectedState);
QCOMPARE(control2.state(), QLowEnergyController::ConnectedState);
control2.disconnectFromDevice();
@@ -1644,7 +1646,7 @@ void tst_QLowEnergyController::tst_defaultBehavior()
void tst_QLowEnergyController::tst_writeCharacteristic()
{
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_MACOS) && !QT_CONFIG(winrt_bt)
QList<QBluetoothHostInfo> localAdapters = QBluetoothLocalDevice::allDevices();
if (localAdapters.isEmpty())
QSKIP("No local Bluetooth device found. Skipping test.");
@@ -1818,7 +1820,7 @@ void tst_QLowEnergyController::tst_writeCharacteristic()
void tst_QLowEnergyController::tst_readWriteDescriptor()
{
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_MACOS) && !QT_CONFIG(winrt_bt)
QList<QBluetoothHostInfo> localAdapters = QBluetoothLocalDevice::allDevices();
if (localAdapters.isEmpty())
QSKIP("No local Bluetooth device found. Skipping test.");
@@ -2241,7 +2243,7 @@ void tst_QLowEnergyController::tst_customProgrammableDevice()
*/
void tst_QLowEnergyController::tst_errorCases()
{
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_MACOS) && !QT_CONFIG(winrt_bt)
QList<QBluetoothHostInfo> localAdapters = QBluetoothLocalDevice::allDevices();
if (localAdapters.isEmpty())
QSKIP("No local Bluetooth device found. Skipping test.");
@@ -2463,7 +2465,7 @@ void tst_QLowEnergyController::tst_errorCases()
*/
void tst_QLowEnergyController::tst_writeCharacteristicNoResponse()
{
-#if !defined(Q_OS_MAC) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_MACOS) && !QT_CONFIG(winrt_bt)
QList<QBluetoothHostInfo> localAdapters = QBluetoothLocalDevice::allDevices();
if (localAdapters.isEmpty())
QSKIP("No local Bluetooth device found. Skipping test.");