diff options
author | Fabian Bumberger <fbumberger@rim.com> | 2013-09-20 15:29:39 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-20 17:47:15 +0200 |
commit | c231e60cd3aa982b10512c5c23bbca04223ed407 (patch) | |
tree | fabf340c905e4237d466f28e17e7dd83e664f804 /tests | |
parent | ac2edceb02a61c1d670312385b1d709417961799 (diff) |
Error handling for QBluetoothServer
Task-number: QTBUG-32669
Change-Id: I0f12b19f7989972b7c8305f6e11a95f7f25a281d
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qrfcommserver/tst_qrfcommserver.cpp | 17 |
2 files changed, 18 insertions, 3 deletions
diff --git a/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp b/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp index a34f289d..e9ad44c1 100644 --- a/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp +++ b/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp @@ -755,10 +755,8 @@ void tst_QBluetoothSocket::tst_error() QCOMPARE(errorSpy.count(), 0); const QBluetoothSocket::SocketError e = socket.error(); - QVERIFY(e != QBluetoothSocket::ConnectionRefusedError - && e != QBluetoothSocket::HostNotFoundError + QVERIFY(e != QBluetoothSocket::HostNotFoundError && e != QBluetoothSocket::NetworkError - && e != QBluetoothSocket::RemoteHostClosedError && e != QBluetoothSocket::ServiceNotFoundError && e != QBluetoothSocket::UnknownSocketError); diff --git a/tests/auto/qrfcommserver/tst_qrfcommserver.cpp b/tests/auto/qrfcommserver/tst_qrfcommserver.cpp index d8324c33..cc64826c 100644 --- a/tests/auto/qrfcommserver/tst_qrfcommserver.cpp +++ b/tests/auto/qrfcommserver/tst_qrfcommserver.cpp @@ -78,6 +78,8 @@ private slots: void tst_receive_data(); void tst_receive(); + void tst_error(); + private: QBluetoothLocalDevice localDevice; }; @@ -311,6 +313,21 @@ void tst_QRfcommServer::tst_secureFlags() QCOMPARE(server.securityFlags(), QBluetooth::Encryption); } + +void tst_QRfcommServer::tst_error() +{ + QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol); + QSignalSpy errorSpy(&server, SIGNAL(error(QBluetoothServer::Error))); + QCOMPARE(errorSpy.count(), 0); + const QBluetoothServer::Error e = server.error(); + + QVERIFY(e != QBluetoothServer::UnknownError + && e != QBluetoothServer::PoweredOffError + && e != QBluetoothServer::InputOutputError + && e != QBluetoothServer::ServiceAlreadyRegisteredError + && e != QBluetoothServer::UnsupportedProtocolError); +} + QTEST_MAIN(tst_QRfcommServer) #include "tst_qrfcommserver.moc" |