summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp4
-rw-r--r--tests/auto/qrfcommserver/tst_qrfcommserver.cpp17
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"