diff options
Diffstat (limited to 'tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp')
-rw-r--r-- | tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp b/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp index fd923f0e..d20458fd 100644 --- a/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp +++ b/tests/auto/qbluetoothdevicediscoveryagent/tst_qbluetoothdevicediscoveryagent.cpp @@ -86,6 +86,8 @@ private slots: void tst_properties(); + void tst_invalidBtAddress(); + void tst_startStopDeviceDiscoveries(); void tst_deviceDiscovery_data(); @@ -143,6 +145,24 @@ void tst_QBluetoothDeviceDiscoveryAgent::tst_properties() QCOMPARE(discoveryAgent.inquiryType(), QBluetoothDeviceDiscoveryAgent::GeneralUnlimitedInquiry); } +void tst_QBluetoothDeviceDiscoveryAgent::tst_invalidBtAddress() +{ + QBluetoothDeviceDiscoveryAgent *discoveryAgent = new QBluetoothDeviceDiscoveryAgent(QBluetoothAddress("11:11:11:11:11:11")); + + QCOMPARE(discoveryAgent->error(), QBluetoothDeviceDiscoveryAgent::InvalidBluetoothAdapterError); + discoveryAgent->start(); + QCOMPARE(discoveryAgent->isActive(), false); + delete discoveryAgent; + + discoveryAgent = new QBluetoothDeviceDiscoveryAgent(QBluetoothAddress()); + QCOMPARE(discoveryAgent->error(), QBluetoothDeviceDiscoveryAgent::NoError); + if (QBluetoothLocalDevice::allDevices().count() > 0) { + discoveryAgent->start(); + QCOMPARE(discoveryAgent->isActive(), true); + } + delete discoveryAgent; +} + void tst_QBluetoothDeviceDiscoveryAgent::deviceDiscoveryDebug(const QBluetoothDeviceInfo &info) { qDebug() << "Discovered device:" << info.address().toString() << info.name(); |