diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2014-11-10 12:15:58 +0100 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2014-11-11 09:15:29 +0100 |
commit | a1cb63d9c2b3a183a0f4afd97837d1ddd6497977 (patch) | |
tree | fda4fc3922bbd42850401c38fb59d1f5c872b92e /tests | |
parent | 93a0343ab23cdb6e098cf8df378deb2195e0ca06 (diff) |
Fixes for QLowEnergyController unit test on Android
It turns out mutliple connections to the sam remote device are
possible. The limitations on Linux are implementation specific. We
lift the general API limitation and document the insufficient behavior
on Linux. A bug has been filed to track this limitation.
On Android, unit tests require widgets support to run as we need a
QGuiApplication.
Change-Id: I37c487246ea6115d3441ca91a920279adbdf726e
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qlowenergycontroller/qlowenergycontroller.pro | 4 | ||||
-rw-r--r-- | tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qlowenergycontroller/qlowenergycontroller.pro b/tests/auto/qlowenergycontroller/qlowenergycontroller.pro index 159f27bf..5360c796 100644 --- a/tests/auto/qlowenergycontroller/qlowenergycontroller.pro +++ b/tests/auto/qlowenergycontroller/qlowenergycontroller.pro @@ -1,4 +1,8 @@ QT = core bluetooth testlib + +# Android requires GUI application when running test +android: QT += widgets + TARGET = tst_qlowenergycontroller CONFIG += testcase diff --git a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp index 3cb57e3f..c9cf1ca1 100644 --- a/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp +++ b/tests/auto/qlowenergycontroller/tst_qlowenergycontroller.cpp @@ -376,7 +376,18 @@ void tst_QLowEnergyController::tst_concurrentDiscovery() 30000); } +#ifdef Q_OS_ANDROID + QCOMPARE(control.state(), QLowEnergyController::ConnectedState); + QCOMPARE(control2.state(), QLowEnergyController::ConnectedState); + control2.disconnectFromDevice(); + QTest::qWait(3000); + QCOMPARE(control.state(), QLowEnergyController::ConnectedState); + QCOMPARE(control2.state(), QLowEnergyController::UnconnectedState); +#else + // see QTBUG-42519 + // Linux cannot maintain two controller connections at the same time QVERIFY(control2.error() != QLowEnergyController::NoError); +#endif } /* We are testing that we can run service discovery on the same device |