summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2013-09-18 17:23:16 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-20 10:09:12 +0200
commitec837633231d0e9c0e70ca3c3d4ad7e1fa548623 (patch)
treea33aa929e47e94fd6d91db9d047285818ee993a5 /tests
parent4a8fe389db0212eb6f85a49612ceddd56dd1aaf4 (diff)
Unify QBluetoothSoket, QBluetoothServer and QBluetoothServiceInfo protocol enum
Change-Id: I6e66196a599e2cceabc7d93d728ba97361d8999f Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp2
-rw-r--r--tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp56
-rw-r--r--tests/auto/ql2capserver/tst_ql2capserver.cpp10
-rw-r--r--tests/auto/qrfcommserver/rfcommclient/rfcommclient.cpp2
-rw-r--r--tests/auto/qrfcommserver/rfcommclient/rfcommclient.h2
-rw-r--r--tests/auto/qrfcommserver/rfcommclient/rfcommclient.pro2
-rw-r--r--tests/auto/qrfcommserver/tst_qrfcommserver.cpp10
7 files changed, 42 insertions, 42 deletions
diff --git a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
index 941245e0..1550642b 100644
--- a/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
+++ b/tests/auto/qbluetoothservicediscoveryagent/tst_qbluetoothservicediscoveryagent.cpp
@@ -266,7 +266,7 @@ void tst_QBluetoothServiceDiscoveryAgent::tst_serviceDiscoveryAdapters()
for (int i=0; i<numberOfAdapters; i++) {
addresses.append(((QBluetoothHostInfo)localDevice.allDevices().at(i)).address());
}
- QBluetoothServer server(QBluetoothServer::RfcommServer);
+ QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol);
QBluetoothUuid uuid(QBluetoothUuid::Ftp);
server.listen(addresses[0]);
QBluetoothServiceInfo serviceInfo;
diff --git a/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp b/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp
index 5e81e114..a34f289d 100644
--- a/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp
+++ b/tests/auto/qbluetoothsocket/tst_qbluetoothsocket.cpp
@@ -56,7 +56,7 @@
QT_USE_NAMESPACE
Q_DECLARE_METATYPE(QBluetoothSocket::SocketState)
-Q_DECLARE_METATYPE(QBluetoothSocket::SocketType)
+Q_DECLARE_METATYPE(QBluetoothServiceInfo::Protocol)
//#define BTADDRESS "00:1A:9F:92:9E:5A"
char BTADDRESS[] = "00:00:00:00:00:00";
@@ -189,21 +189,21 @@ void tst_QBluetoothSocket::serviceDiscovered(const QBluetoothServiceInfo &info)
void tst_QBluetoothSocket::tst_construction_data()
{
- QTest::addColumn<QBluetoothSocket::SocketType>("socketType");
+ QTest::addColumn<QBluetoothServiceInfo::Protocol>("socketType");
- QTest::newRow("unknown socket") << QBluetoothSocket::UnknownSocketType;
- QTest::newRow("rfcomm socket") << QBluetoothSocket::RfcommSocket;
- QTest::newRow("l2cap socket") << QBluetoothSocket::L2capSocket;
+ QTest::newRow("unknown protocol") << QBluetoothServiceInfo::UnknownProtocol;
+ QTest::newRow("rfcomm socket") << QBluetoothServiceInfo::RfcommProtocol;
+ QTest::newRow("l2cap socket") << QBluetoothServiceInfo::L2capProtocol;
}
void tst_QBluetoothSocket::tst_construction()
{
- QFETCH(QBluetoothSocket::SocketType, socketType);
+ QFETCH(QBluetoothServiceInfo::Protocol, socketType);
{
QBluetoothSocket socket;
- QCOMPARE(socket.socketType(), QBluetoothSocket::UnknownSocketType);
+ QCOMPARE(socket.socketType(), QBluetoothServiceInfo::UnknownProtocol);
}
{
@@ -215,7 +215,7 @@ void tst_QBluetoothSocket::tst_construction()
void tst_QBluetoothSocket::tst_clientConnection_data()
{
- QTest::addColumn<QBluetoothSocket::SocketType>("sockettype");
+ QTest::addColumn<QBluetoothServiceInfo::Protocol>("socketprotocol");
QTest::addColumn<ClientConnectionShutdown>("shutdown");
QTest::addColumn<QBluetoothAddress>("address");
QTest::addColumn<quint16>("port");
@@ -225,41 +225,41 @@ void tst_QBluetoothSocket::tst_clientConnection_data()
QBluetoothAddress address(BTADDRESS);
quint16 port = 10;
- QTest::newRow("unavailable, error") << QBluetoothSocket::RfcommSocket
+ QTest::newRow("unavailable, error") << QBluetoothServiceInfo::RfcommProtocol
<< Error << QBluetoothAddress("112233445566") << quint16(10) << QByteArray();
- QTest::newRow("available, disconnect") << QBluetoothSocket::RfcommSocket
+ QTest::newRow("available, disconnect") << QBluetoothServiceInfo::RfcommProtocol
<< Disconnect << address << port << QByteArray();
- QTest::newRow("available, disconnect with data") << QBluetoothSocket::RfcommSocket
+ QTest::newRow("available, disconnect with data") << QBluetoothServiceInfo::RfcommProtocol
<< Disconnect << address << port << QByteArray("Test message\n");
- QTest::newRow("available, close") << QBluetoothSocket::RfcommSocket
+ QTest::newRow("available, close") << QBluetoothServiceInfo::RfcommProtocol
<< Close << address << port << QByteArray();
- QTest::newRow("available, abort") << QBluetoothSocket::RfcommSocket
+ QTest::newRow("available, abort") << QBluetoothServiceInfo::RfcommProtocol
<< Abort << address << port << QByteArray();
- QTest::newRow("available, abort with data") << QBluetoothSocket::RfcommSocket
+ QTest::newRow("available, abort with data") << QBluetoothServiceInfo::RfcommProtocol
<< Abort << address << port << QByteArray("Test message\n");
port = 0x1011;
- QTest::newRow("unavailable, error") << QBluetoothSocket::L2capSocket
+ QTest::newRow("unavailable, error") << QBluetoothServiceInfo::L2capProtocol
<< Error << QBluetoothAddress("112233445566") << quint16(10) << QByteArray();
- QTest::newRow("available, disconnect") << QBluetoothSocket::L2capSocket
+ QTest::newRow("available, disconnect") << QBluetoothServiceInfo::L2capProtocol
<< Disconnect << address << port << QByteArray();
- QTest::newRow("available, disconnect with data") << QBluetoothSocket::L2capSocket
+ QTest::newRow("available, disconnect with data") << QBluetoothServiceInfo::L2capProtocol
<< Disconnect << address << port << QByteArray("Test message\n");
- QTest::newRow("available, close") << QBluetoothSocket::L2capSocket
+ QTest::newRow("available, close") << QBluetoothServiceInfo::L2capProtocol
<< Close << address << port << QByteArray();
- QTest::newRow("available, abort") << QBluetoothSocket::L2capSocket
+ QTest::newRow("available, abort") << QBluetoothServiceInfo::L2capProtocol
<< Abort << address << port << QByteArray();
- QTest::newRow("available, abort with data") << QBluetoothSocket::L2capSocket
+ QTest::newRow("available, abort with data") << QBluetoothServiceInfo::L2capProtocol
<< Abort << address << port << QByteArray("Test message\n");
}
void tst_QBluetoothSocket::tst_clientConnection()
{
- QFETCH(QBluetoothSocket::SocketType, sockettype);
+ QFETCH(QBluetoothServiceInfo::Protocol, socketprotocol);
QFETCH(ClientConnectionShutdown, shutdown);
QFETCH(QBluetoothAddress, address);
QFETCH(quint16, port);
@@ -268,11 +268,11 @@ void tst_QBluetoothSocket::tst_clientConnection()
tryagain:
/* Construction */
- QBluetoothSocket *socket = new QBluetoothSocket(sockettype);
+ QBluetoothSocket *socket = new QBluetoothSocket(socketprotocol);
QSignalSpy stateSpy(socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState)));
- QCOMPARE(socket->socketType(), sockettype);
+ QCOMPARE(socket->socketType(), socketprotocol);
QCOMPARE(socket->state(), QBluetoothSocket::UnconnectedState);
/* Connection */
@@ -420,7 +420,7 @@ void tst_QBluetoothSocket::tst_serviceConnection()
QSignalSpy stateSpy(socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState)));
- QCOMPARE(socket->socketType(), QBluetoothSocket::UnknownSocketType);
+ QCOMPARE(socket->socketType(), QBluetoothServiceInfo::UnknownProtocol);
QCOMPARE(socket->state(), QBluetoothSocket::UnconnectedState);
/* Connection */
@@ -494,11 +494,11 @@ void tst_QBluetoothSocket::tst_clientCommunication()
QFETCH(QStringList, data);
/* Construction */
- QBluetoothSocket *socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket);
+ QBluetoothSocket *socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
QSignalSpy stateSpy(socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState)));
- QCOMPARE(socket->socketType(), QBluetoothSocket::RfcommSocket);
+ QCOMPARE(socket->socketType(), QBluetoothServiceInfo::RfcommProtocol);
QCOMPARE(socket->state(), QBluetoothSocket::UnconnectedState);
/* Connection */
@@ -686,11 +686,11 @@ void tst_QBluetoothSocket::tst_localPeer()
/* Construction */
- QBluetoothSocket *socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket);
+ QBluetoothSocket *socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
QSignalSpy stateSpy(socket, SIGNAL(stateChanged(QBluetoothSocket::SocketState)));
- QCOMPARE(socket->socketType(), QBluetoothSocket::RfcommSocket);
+ QCOMPARE(socket->socketType(), QBluetoothServiceInfo::RfcommProtocol);
QCOMPARE(socket->state(), QBluetoothSocket::UnconnectedState);
/* Connection */
diff --git a/tests/auto/ql2capserver/tst_ql2capserver.cpp b/tests/auto/ql2capserver/tst_ql2capserver.cpp
index 26c68cad..d8a5d0d4 100644
--- a/tests/auto/ql2capserver/tst_ql2capserver.cpp
+++ b/tests/auto/ql2capserver/tst_ql2capserver.cpp
@@ -94,7 +94,7 @@ void tst_QL2capServer::initTestCase()
void tst_QL2capServer::tst_construction()
{
{
- QBluetoothServer server(QBluetoothServer::L2capServer);
+ QBluetoothServer server(QBluetoothServiceInfo::L2capProtocol);
QVERIFY(!server.isListening());
QCOMPARE(server.maxPendingConnections(), 1);
@@ -122,7 +122,7 @@ void tst_QL2capServer::tst_listen()
QFETCH(quint16, port);
{
- QBluetoothServer server(QBluetoothServer::L2capServer);
+ QBluetoothServer server(QBluetoothServiceInfo::L2capProtocol);
bool result = server.listen(address, port);
@@ -169,7 +169,7 @@ void tst_QL2capServer::tst_pendingConnections()
QFETCH(int, maxConnections);
{
- QBluetoothServer server(QBluetoothServer::L2capServer);
+ QBluetoothServer server(QBluetoothServiceInfo::L2capProtocol);
server.setMaxPendingConnections(maxConnections);
@@ -235,7 +235,7 @@ void tst_QL2capServer::tst_receive()
{
QFETCH(QByteArray, expected);
- QBluetoothServer server(QBluetoothServer::L2capServer);
+ QBluetoothServer server(QBluetoothServiceInfo::L2capProtocol);
bool result = server.listen();
@@ -273,7 +273,7 @@ void tst_QL2capServer::tst_receive()
void tst_QL2capServer::tst_secureFlags()
{
- QBluetoothServer server(QBluetoothServer::L2capServer);
+ QBluetoothServer server(QBluetoothServiceInfo::L2capProtocol);
QCOMPARE(server.securityFlags(), QBluetooth::NoSecurity);
server.setSecurityFlags(QBluetooth::Encryption);
diff --git a/tests/auto/qrfcommserver/rfcommclient/rfcommclient.cpp b/tests/auto/qrfcommserver/rfcommclient/rfcommclient.cpp
index fff049d8..0aa83016 100644
--- a/tests/auto/qrfcommserver/rfcommclient/rfcommclient.cpp
+++ b/tests/auto/qrfcommserver/rfcommclient/rfcommclient.cpp
@@ -106,7 +106,7 @@ void RfCommClient::startClient(const QBluetoothServiceInfo &remoteService)
// Connect to service
if (state == listening)
state = pendingConnections;
- socket = new QBluetoothSocket(QBluetoothSocket::RfcommSocket);
+ socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
qDebug() << "Create socket";
socket->connectToService(remoteService);
qDebug() << "ConnecttoService done";
diff --git a/tests/auto/qrfcommserver/rfcommclient/rfcommclient.h b/tests/auto/qrfcommserver/rfcommclient/rfcommclient.h
index 6bd70b8f..48f1e760 100644
--- a/tests/auto/qrfcommserver/rfcommclient/rfcommclient.h
+++ b/tests/auto/qrfcommserver/rfcommclient/rfcommclient.h
@@ -48,7 +48,7 @@
#include <QtCore/QObject>
#include <QtCore/QTime>
#include <QtCore/QTimer>
-#include <QBluetoothLocalDevice.h>
+#include <QBluetoothLocalDevice>
#include <QThread>
static const QLatin1String serviceUuid("e8e10f95-1a70-4b27-9ccf-02010264e9c9");
diff --git a/tests/auto/qrfcommserver/rfcommclient/rfcommclient.pro b/tests/auto/qrfcommserver/rfcommclient/rfcommclient.pro
index af41627a..8c28a661 100644
--- a/tests/auto/qrfcommserver/rfcommclient/rfcommclient.pro
+++ b/tests/auto/qrfcommserver/rfcommclient/rfcommclient.pro
@@ -2,5 +2,5 @@ TARGET = rfcommclient
SOURCES += main.cpp rfcommclient.cpp
HEADERS += rfcommclient.h
-QT = core
+QT = core bluetooth
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qrfcommserver/tst_qrfcommserver.cpp b/tests/auto/qrfcommserver/tst_qrfcommserver.cpp
index 3620600e..d8324c33 100644
--- a/tests/auto/qrfcommserver/tst_qrfcommserver.cpp
+++ b/tests/auto/qrfcommserver/tst_qrfcommserver.cpp
@@ -118,7 +118,7 @@ void tst_QRfcommServer::initTestCase()
void tst_QRfcommServer::tst_construction()
{
{
- QBluetoothServer server(QBluetoothServer::RfcommServer);
+ QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol);
QVERIFY(!server.isListening());
QCOMPARE(server.maxPendingConnections(), 1);
@@ -146,7 +146,7 @@ void tst_QRfcommServer::tst_listen()
QFETCH(quint16, port);
{
- QBluetoothServer server(QBluetoothServer::RfcommServer);
+ QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol);
qDebug() << "tst_listen() address=" << address.toString() << "port=" << port;
bool result = server.listen(address, port);
QTest::qWait(1000);
@@ -193,7 +193,7 @@ void tst_QRfcommServer::tst_pendingConnections()
{
QFETCH(int, maxConnections);
- QBluetoothServer server(QBluetoothServer::RfcommServer);
+ QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol);
QBluetoothLocalDevice localDev;
QBluetoothAddress address = localDev.address();
@@ -258,7 +258,7 @@ void tst_QRfcommServer::tst_receive()
{
QFETCH(QByteArray, expected);
- QBluetoothServer server(QBluetoothServer::RfcommServer);
+ QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol);
QBluetoothLocalDevice localDev;
QBluetoothAddress address = localDev.address();
@@ -302,7 +302,7 @@ void tst_QRfcommServer::tst_receive()
void tst_QRfcommServer::tst_secureFlags()
{
- QBluetoothServer server(QBluetoothServer::RfcommServer);
+ QBluetoothServer server(QBluetoothServiceInfo::RfcommProtocol);
server.setSecurityFlags(QBluetooth::NoSecurity);
QCOMPARE(server.securityFlags(), QBluetooth::NoSecurity);