diff options
author | Michael Zanetti <michael.zanetti@nokia.com> | 2011-09-07 12:02:00 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-07 03:31:39 +0200 |
commit | bd4df1e8e148cee77f76830a43ddc044b7a6903c (patch) | |
tree | c6a5aedafa2670e0b193843bd0271306eefdecd7 /src/bluetooth | |
parent | 5788b49130e1b2648beab531016d1e61cf3d5444 (diff) |
re-added autotests
Change-Id: Ic2be21fd11e2fdb96185fe9269cebbe08b6de87a
Reviewed-on: http://codereview.qt-project.org/4783
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Alex <alex.blasche@nokia.com>
Diffstat (limited to 'src/bluetooth')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp | 20 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp | 2 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothglobal.h | 11 | ||||
-rw-r--r-- | src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp | 26 |
4 files changed, 24 insertions, 35 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp index 3a510afa..a0b0f052 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_bluez.cpp @@ -48,7 +48,7 @@ #include "bluez/adapter_p.h" #include "bluez/device_p.h" -//#define QTM_DEVICEDISCOVERY_DEBUG +//#define QT_DEVICEDISCOVERY_DEBUG QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate() : lastError(QBluetoothDeviceDiscoveryAgent::NoError), pendingCancel(false), pendingStart(false), adapter(0) @@ -86,7 +86,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start() reply.waitForFinished(); if (reply.isError()) { errorString = reply.error().message(); -#ifdef QTM_DEVICEDISCOVERY_DEBUG +#ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO << "ERROR: " << errorString; #endif lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; @@ -107,7 +107,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start() QDBusPendingReply<QVariantMap> propertiesReply = adapter->GetProperties(); propertiesReply.waitForFinished(); if(propertiesReply.isError()) { -#ifdef QTM_DEVICEDISCOVERY_DEBUG +#ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO << "ERROR: " << errorString; #endif errorString = propertiesReply.error().message(); @@ -125,7 +125,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start() lastError = QBluetoothDeviceDiscoveryAgent::IOFailure; Q_Q(QBluetoothDeviceDiscoveryAgent); emit q->error(lastError); -#ifdef QTM_DEVICEDISCOVERY_DEBUG +#ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO << "ERROR: " << errorString; #endif return; @@ -135,7 +135,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::start() void QBluetoothDeviceDiscoveryAgentPrivate::stop() { if (adapter) { -#ifdef QTM_DEVICEDISCOVERY_DEBUG +#ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO; #endif pendingCancel = true; @@ -152,7 +152,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_deviceFound(const QString &addres const QString btName = dict.value(QLatin1String("Name")).toString(); quint32 btClass = dict.value(QLatin1String("Class")).toUInt(); -#ifdef QTM_DEVICEDISCOVERY_DEBUG +#ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << "Discovered: " << address << btName << "Num UUIDs" << dict.value(QLatin1String("UUIDs")).toStringList().count() << "total device" << discoveredDevices.count() << "cached" @@ -172,14 +172,14 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_deviceFound(const QString &addres for(int i = 0; i < discoveredDevices.size(); i++){ if(discoveredDevices[i].address() == device.address()) { if(discoveredDevices[i] == device) { -#ifdef QTM_DEVICEDISCOVERY_DEBUG +#ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << "Duplicate: " << address; #endif return; } discoveredDevices.replace(i, device); Q_Q(QBluetoothDeviceDiscoveryAgent); -#ifdef QTM_DEVICEDISCOVERY_DEBUG +#ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << "Updated: " << address; #endif @@ -187,7 +187,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_deviceFound(const QString &addres return; // this works if the list doesn't contain duplicates. Don't let it. } } -#ifdef QTM_DEVICEDISCOVERY_DEBUG +#ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << "Emit: " << address; #endif discoveredDevices.append(device); @@ -198,7 +198,7 @@ void QBluetoothDeviceDiscoveryAgentPrivate::_q_deviceFound(const QString &addres void QBluetoothDeviceDiscoveryAgentPrivate::_q_propertyChanged(const QString &name, const QDBusVariant &value) { -#ifdef QTM_DEVICEDISCOVERY_DEBUG +#ifdef QT_DEVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO << name << value.variant(); #endif diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp index 83b4a623..7052f857 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_p.cpp @@ -44,7 +44,7 @@ #include "qbluetoothaddress.h" #include "qbluetoothuuid.h" -#define QTM_DEVICEDISCOVERY_DEBUG +#define QT_DEVICEDISCOVERY_DEBUG QBluetoothDeviceDiscoveryAgentPrivate::QBluetoothDeviceDiscoveryAgentPrivate() diff --git a/src/bluetooth/qbluetoothglobal.h b/src/bluetooth/qbluetoothglobal.h index 02afa7bf..973e517b 100644 --- a/src/bluetooth/qbluetoothglobal.h +++ b/src/bluetooth/qbluetoothglobal.h @@ -69,15 +69,4 @@ # endif #endif -#include <QtCore/qglobal.h> -#if defined(QTM_BUILD_UNITTESTS) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_MAKEDLL) -# define QM_AUTOTEST_EXPORT Q_DECL_EXPORT -#elif defined(QTM_BUILD_UNITTESTS) && (defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_DLL) -# define QM_AUTOTEST_EXPORT Q_DECL_IMPORT -#elif defined(QTM_BUILD_UNITTESTS) && !(defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)) && defined(QT_SHARED) -# define QM_AUTOTEST_EXPORT Q_DECL_EXPORT -#else -# define QM_AUTOTEST_EXPORT -#endif - #endif // QTBLUETOOTH_H diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp index abcaa23d..af24f8ac 100644 --- a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp +++ b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp @@ -48,9 +48,9 @@ #include <QtDBus/QDBusPendingCallWatcher> -//#define QTM_SERVICEDISCOVERY_DEBUG +//#define QT_SERVICEDISCOVERY_DEBUG -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG #include <QtCore/QDebug> #endif @@ -73,7 +73,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::start(const QBluetoothAddress &addr { Q_Q(QBluetoothServiceDiscoveryAgent); -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << "Full discovery on: " << address.toString(); #endif @@ -106,7 +106,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::start(const QBluetoothAddress &addr void QBluetoothServiceDiscoveryAgentPrivate::stop() { -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO << "Stop called"; #endif if(device){ @@ -128,7 +128,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_createdDevice(QDBusPendingCallWa const QBluetoothAddress &address = watcher->property("_q_BTaddress").value<QBluetoothAddress>(); -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO << "created" << address.toString(); #endif @@ -136,7 +136,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_createdDevice(QDBusPendingCallWa if (deviceObjectPath.isError()) { if (deviceObjectPath.error().name() != QLatin1String("org.bluez.Error.AlreadyExists")) { _q_serviceDiscoveryFinished(); -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << "Create device failed Error: " << error << deviceObjectPath.error().name(); #endif return; @@ -151,7 +151,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_createdDevice(QDBusPendingCallWa emit q->error(error); } _q_serviceDiscoveryFinished(); -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << "Can't find device after creation Error: " << error << deviceObjectPath.error().name(); #endif return; @@ -173,7 +173,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_createdDevice(QDBusPendingCallWa foreach (const QBluetoothUuid &uuid, uuidFilter) pattern += uuid.toString().remove(QLatin1Char('{')).remove(QLatin1Char('}')) + QLatin1Char(' '); -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO << "Discover: " << pattern.trimmed(); #endif QDBusPendingReply<ServiceMap> discoverReply = device->DiscoverServices(pattern.trimmed()); @@ -185,13 +185,13 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_createdDevice(QDBusPendingCallWa void QBluetoothServiceDiscoveryAgentPrivate::_q_discoveredServices(QDBusPendingCallWatcher *watcher) { -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << Q_FUNC_INFO; #endif QDBusPendingReply<ServiceMap> reply = *watcher; if (reply.isError()) { -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << "discoveredServices error: " << error << reply.error().message(); #endif watcher->deleteLater(); @@ -207,14 +207,14 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_discoveredServices(QDBusPendingC ServiceMap map = reply.value(); -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << "Parsing xml" << discoveredDevices.at(0).address().toString() << discoveredDevices.count() << map.count(); #endif foreach (const QString &record, reply.value()) { QXmlStreamReader xml(record); -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG // qDebug() << "Service xml" << record; #endif @@ -243,7 +243,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_discoveredServices(QDBusPendingC Q_Q(QBluetoothServiceDiscoveryAgent); discoveredServices.append(serviceInfo); -#ifdef QTM_SERVICEDISCOVERY_DEBUG +#ifdef QT_SERVICEDISCOVERY_DEBUG qDebug() << "Discovered services" << discoveredDevices.at(0).address().toString(); #endif emit q->serviceDiscovered(serviceInfo); |