diff options
author | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-02-04 16:07:43 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@theqtcompany.com> | 2016-02-09 16:25:40 +0000 |
commit | 547c931904e5251fe79413ba933506a88df0fbbb (patch) | |
tree | 896896dc03feb6ede09ce7ea3eab5fdfe0fae209 /tests/auto/qlowenergycontroller-gattserver | |
parent | a56a776d4199568657f10248d387c87e40c508fc (diff) |
Bluetooth LE: Fix two list setter functions.
Adding the new list elements is all well and nice, but we have to clear
the existing ones first.
Change-Id: I1b044f2ea86a4a300bde93535a944c18328aa805
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'tests/auto/qlowenergycontroller-gattserver')
-rw-r--r-- | tests/auto/qlowenergycontroller-gattserver/test/tst_qlowenergycontroller-gattserver.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/qlowenergycontroller-gattserver/test/tst_qlowenergycontroller-gattserver.cpp b/tests/auto/qlowenergycontroller-gattserver/test/tst_qlowenergycontroller-gattserver.cpp index 5acffcab..8b11e5a7 100644 --- a/tests/auto/qlowenergycontroller-gattserver/test/tst_qlowenergycontroller-gattserver.cpp +++ b/tests/auto/qlowenergycontroller-gattserver/test/tst_qlowenergycontroller-gattserver.cpp @@ -500,6 +500,10 @@ void TestQLowEnergyControllerGattServer::serviceData() charData.setWriteConstraints(AttAuthenticationRequired | AttAuthorizationRequired); QCOMPARE(charData.writeConstraints(), AttAuthenticationRequired | AttAuthorizationRequired); + charData.addDescriptor(descData); + QCOMPARE(charData.descriptors().count(), 1); + charData.setDescriptors(QList<QLowEnergyDescriptorData>()); + QCOMPARE(charData.descriptors().count(), 0); charData.setDescriptors(QList<QLowEnergyDescriptorData>() << descData << descData2); QLowEnergyDescriptorData descData3(QBluetoothUuid::ExternalReportReference, "someval"); charData.addDescriptor(descData3); @@ -518,6 +522,10 @@ void TestQLowEnergyControllerGattServer::serviceData() secondaryData.setType(QLowEnergyServiceData::ServiceTypeSecondary); QCOMPARE(secondaryData.type(), QLowEnergyServiceData::ServiceTypeSecondary); + secondaryData.addCharacteristic(charData); + QCOMPARE(secondaryData.characteristics().count(), 1); + secondaryData.setCharacteristics(QList<QLowEnergyCharacteristicData>()); + QCOMPARE(secondaryData.characteristics().count(), 0); secondaryData.setCharacteristics(QList<QLowEnergyCharacteristicData>() << charData << QLowEnergyCharacteristicData()); QCOMPARE(secondaryData.characteristics(), QList<QLowEnergyCharacteristicData>() << charData); |