From a0ab76a6f505fe6cf0e8f08a3166bb9e145596ce Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Tue, 23 Jun 2020 17:04:59 +0200 Subject: [PATCH] Use QList instead of QVector in qtcoap And fix dependencies. Task-number: QTBUG-84469 Change-Id: Ic68bcf0229b516a04ba3d9e515dfb992e12d1f49 Reviewed-by: Jarek Kobus --- dependencies.yaml | 2 +- .../coap/consolecoapclient/coaphandler.cpp | 2 +- examples/coap/consolecoapclient/coaphandler.h | 2 +- .../qmlcoapmulticastclient.cpp | 2 +- .../qmlcoapmulticastclient.h | 2 +- examples/coap/simplecoapclient/mainwindow.cpp | 2 +- examples/coap/simplecoapclient/mainwindow.h | 4 +-- .../coap/simplecoapclient/optiondialog.cpp | 2 +- examples/coap/simplecoapclient/optiondialog.h | 4 +-- src/coap/doc/src/qtcoap-overview.qdoc | 2 +- src/coap/qcoapinternalrequest.cpp | 2 +- src/coap/qcoapmessage.cpp | 10 +++---- src/coap/qcoapmessage.h | 8 +++--- src/coap/qcoapmessage_p.h | 4 +-- src/coap/qcoapprotocol.cpp | 4 +-- src/coap/qcoapprotocol_p.h | 6 ++--- src/coap/qcoapresourcediscoveryreply.cpp | 8 +++--- src/coap/qcoapresourcediscoveryreply.h | 4 +-- src/coap/qcoapresourcediscoveryreply_p.h | 4 +-- src/coap/qcoapsecurityconfiguration.cpp | 14 +++++----- src/coap/qcoapsecurityconfiguration.h | 8 +++--- tests/auto/qcoapclient/tst_qcoapclient.cpp | 4 +-- .../tst_qcoapinternalrequest.cpp | 20 +++++++------- tests/auto/qcoapmessage/tst_qcoapmessage.cpp | 26 +++++++++---------- .../auto/qcoapresource/tst_qcoapresource.cpp | 2 +- 25 files changed, 74 insertions(+), 74 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index e02a885..d64cd29 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -1,4 +1,4 @@ dependencies: ../qtbase: - ref: 56f40cdca6b589beec5c2cb803633985ca4c59d1 + ref: bcc3472aa231d0a65351b73ce9c75f7688be6623 required: true diff --git a/examples/coap/consolecoapclient/coaphandler.cpp b/examples/coap/consolecoapclient/coaphandler.cpp index fa9fc34..6aa1808 100644 --- a/examples/coap/consolecoapclient/coaphandler.cpp +++ b/examples/coap/consolecoapclient/coaphandler.cpp @@ -105,7 +105,7 @@ void CoapHandler::onNotified(QCoapReply *reply, QCoapMessage message) qCInfo(lcCoapClient) << "Received Observe notification with payload:" << reply->readAll(); } -void CoapHandler::onDiscovered(QCoapResourceDiscoveryReply *reply, QVector resources) +void CoapHandler::onDiscovered(QCoapResourceDiscoveryReply *reply, QList resources) { Q_UNUSED(reply) diff --git a/examples/coap/consolecoapclient/coaphandler.h b/examples/coap/consolecoapclient/coaphandler.h index a109a4c..af7dfd9 100644 --- a/examples/coap/consolecoapclient/coaphandler.h +++ b/examples/coap/consolecoapclient/coaphandler.h @@ -61,7 +61,7 @@ public: public Q_SLOTS: void onFinished(QCoapReply *reply); void onNotified(QCoapReply *reply, QCoapMessage message); - void onDiscovered(QCoapResourceDiscoveryReply *reply, QVector resources); + void onDiscovered(QCoapResourceDiscoveryReply *reply, QList resources); void onResponseToMulticast(QCoapReply *reply, const QCoapMessage& message, const QHostAddress &sender); void onError(QCoapReply *reply, QtCoap::Error error); diff --git a/examples/coap/quickmulticastclient/qmlcoapmulticastclient.cpp b/examples/coap/quickmulticastclient/qmlcoapmulticastclient.cpp index af8c788..399c3c0 100644 --- a/examples/coap/quickmulticastclient/qmlcoapmulticastclient.cpp +++ b/examples/coap/quickmulticastclient/qmlcoapmulticastclient.cpp @@ -95,7 +95,7 @@ void QmlCoapMulticastClient::discover(QtCoap::MulticastGroup group, int port, } void QmlCoapMulticastClient::onDiscovered(QCoapResourceDiscoveryReply *reply, - const QVector &resources) + const QList &resources) { Q_UNUSED(reply) for (auto resource : resources) diff --git a/examples/coap/quickmulticastclient/qmlcoapmulticastclient.h b/examples/coap/quickmulticastclient/qmlcoapmulticastclient.h index ecb1415..89b3cfc 100644 --- a/examples/coap/quickmulticastclient/qmlcoapmulticastclient.h +++ b/examples/coap/quickmulticastclient/qmlcoapmulticastclient.h @@ -85,7 +85,7 @@ Q_SIGNALS: void finished(int error); public slots: - void onDiscovered(QCoapResourceDiscoveryReply *reply, const QVector &resources); + void onDiscovered(QCoapResourceDiscoveryReply *reply, const QList &resources); }; #endif // QMLCOAPMULTICASTCLIENT_H diff --git a/examples/coap/simplecoapclient/mainwindow.cpp b/examples/coap/simplecoapclient/mainwindow.cpp index 19f907a..810683c 100644 --- a/examples/coap/simplecoapclient/mainwindow.cpp +++ b/examples/coap/simplecoapclient/mainwindow.cpp @@ -122,7 +122,7 @@ void MainWindow::onError(QCoapReply *reply, QtCoap::Error error) addMessage(errorMessage(errorCode), true); } -void MainWindow::onDiscovered(QCoapResourceDiscoveryReply *reply, QVector resources) +void MainWindow::onDiscovered(QCoapResourceDiscoveryReply *reply, QList resources) { if (reply->errorReceived() != QtCoap::Error::Ok) return; diff --git a/examples/coap/simplecoapclient/mainwindow.h b/examples/coap/simplecoapclient/mainwindow.h index 2cb9f98..8ae1509 100644 --- a/examples/coap/simplecoapclient/mainwindow.h +++ b/examples/coap/simplecoapclient/mainwindow.h @@ -78,7 +78,7 @@ private: private slots: void onFinished(QCoapReply *reply); void onError(QCoapReply *reply, QtCoap::Error error); - void onDiscovered(QCoapResourceDiscoveryReply *reply, QVector resources); + void onDiscovered(QCoapResourceDiscoveryReply *reply, QList resources); void onNotified(QCoapReply *reply, const QCoapMessage &message); void on_runButton_clicked(); @@ -92,7 +92,7 @@ private slots: private: Ui::MainWindow *ui; QCoapClient *m_client; - QVector m_options; + QList m_options; QByteArray m_currentData; }; diff --git a/examples/coap/simplecoapclient/optiondialog.cpp b/examples/coap/simplecoapclient/optiondialog.cpp index 5125541..2df95a9 100644 --- a/examples/coap/simplecoapclient/optiondialog.cpp +++ b/examples/coap/simplecoapclient/optiondialog.cpp @@ -68,7 +68,7 @@ OptionDialog::~OptionDialog() delete ui; } -QVector OptionDialog::options() const +QList OptionDialog::options() const { return m_options; } diff --git a/examples/coap/simplecoapclient/optiondialog.h b/examples/coap/simplecoapclient/optiondialog.h index ecd0b34..565b04b 100644 --- a/examples/coap/simplecoapclient/optiondialog.h +++ b/examples/coap/simplecoapclient/optiondialog.h @@ -68,7 +68,7 @@ public: explicit OptionDialog(QWidget *parent = nullptr); ~OptionDialog(); - QVector options() const; + QList options() const; private slots: void on_addButton_clicked(); @@ -78,7 +78,7 @@ private: void fillOptions(); Ui::OptionDialog *ui; - QVector m_options; + QList m_options; }; #endif // OPTIONDIALOG_H diff --git a/src/coap/doc/src/qtcoap-overview.qdoc b/src/coap/doc/src/qtcoap-overview.qdoc index c686974..273e99e 100644 --- a/src/coap/doc/src/qtcoap-overview.qdoc +++ b/src/coap/doc/src/qtcoap-overview.qdoc @@ -184,7 +184,7 @@ And in certificate mode: \code QCoapClient *client = new QCoapClient(this, QtCoap::Certificate); - QVector localCertificates, caCertificates; + QList localCertificates, caCertificates; QCoapPrivateKey key; // Initialize the key and certificates QCoapSecurityConfiguration config; diff --git a/src/coap/qcoapinternalrequest.cpp b/src/coap/qcoapinternalrequest.cpp index 960e9aa..48a2b9f 100644 --- a/src/coap/qcoapinternalrequest.cpp +++ b/src/coap/qcoapinternalrequest.cpp @@ -183,7 +183,7 @@ QByteArray QCoapInternalRequest::toQByteArray() const // Insert Options if (!d->message.options().isEmpty()) { - QVector options = d->message.options(); + const auto options = d->message.options(); // Options should be sorted in order of their option numbers Q_ASSERT(std::is_sorted(d->message.options().cbegin(), d->message.options().cend(), diff --git a/src/coap/qcoapmessage.cpp b/src/coap/qcoapmessage.cpp index d1ad665..9909fcf 100644 --- a/src/coap/qcoapmessage.cpp +++ b/src/coap/qcoapmessage.cpp @@ -277,7 +277,7 @@ QCoapOption QCoapMessage::option(QCoapOption::OptionName name) const with the given \a name. If there is no such option, returns \c d->options.end(). */ -QVector::const_iterator +QList::const_iterator QCoapMessagePrivate::findOption(QCoapOption::OptionName name) const { return std::find_if(options.begin(), options.end(), [name](const QCoapOption &option) { @@ -298,7 +298,7 @@ bool QCoapMessage::hasOption(QCoapOption::OptionName name) const /*! Returns the list of options. */ -const QVector &QCoapMessage::options() const +const QList &QCoapMessage::options() const { Q_D(const QCoapMessage); return d->options; @@ -307,11 +307,11 @@ const QVector &QCoapMessage::options() const /*! Finds and returns the list of options with the given \a name. */ -QVector QCoapMessage::options(QCoapOption::OptionName name) const +QList QCoapMessage::options(QCoapOption::OptionName name) const { Q_D(const QCoapMessage); - QVector result; + QList result; std::copy_if(d->options.cbegin(), d->options.cend(), std::back_inserter(result), [name](const QCoapOption &option) { return option.name() == name; @@ -392,7 +392,7 @@ void QCoapMessage::setPayload(const QByteArray &payload) /*! Sets the message options to \a options. */ -void QCoapMessage::setOptions(const QVector &options) +void QCoapMessage::setOptions(const QList &options) { Q_D(QCoapMessage); d->options = options; diff --git a/src/coap/qcoapmessage.h b/src/coap/qcoapmessage.h index 200a44b..ee3bf0d 100644 --- a/src/coap/qcoapmessage.h +++ b/src/coap/qcoapmessage.h @@ -34,8 +34,8 @@ #include #include #include +#include #include -#include #include QT_BEGIN_NAMESPACE @@ -70,13 +70,13 @@ public: void setToken(const QByteArray &token); void setMessageId(quint16); void setPayload(const QByteArray &payload); - void setOptions(const QVector &options); + void setOptions(const QList &options); QCoapOption optionAt(int index) const; QCoapOption option(QCoapOption::OptionName name) const; bool hasOption(QCoapOption::OptionName name) const; - const QVector &options() const; - QVector options(QCoapOption::OptionName name) const; + const QList &options() const; + QList options(QCoapOption::OptionName name) const; int optionCount() const; void addOption(QCoapOption::OptionName name, const QByteArray &value = QByteArray()); void addOption(const QCoapOption &option); diff --git a/src/coap/qcoapmessage_p.h b/src/coap/qcoapmessage_p.h index fbff1b8..aca093d 100644 --- a/src/coap/qcoapmessage_p.h +++ b/src/coap/qcoapmessage_p.h @@ -55,13 +55,13 @@ public: QCoapMessagePrivate(const QCoapMessagePrivate &other); ~QCoapMessagePrivate(); - QVector::const_iterator findOption(QCoapOption::OptionName name) const; + QList::const_iterator findOption(QCoapOption::OptionName name) const; quint8 version = 1; QCoapMessage::Type type = QCoapMessage::Type::NonConfirmable; quint16 messageId = 0; QByteArray token; - QVector options; + QList options; QByteArray payload; }; diff --git a/src/coap/qcoapprotocol.cpp b/src/coap/qcoapprotocol.cpp index 9d365c6..c9e720d 100644 --- a/src/coap/qcoapprotocol.cpp +++ b/src/coap/qcoapprotocol.cpp @@ -440,7 +440,7 @@ QPointer QCoapProtocolPrivate::userReplyForToken(const QCoapToken &t Returns the replies for the exchange identified by \a token. */ -QVector> +QList> QCoapProtocolPrivate::repliesForToken(const QCoapToken &token) const { auto it = exchangeMap.find(token); @@ -772,7 +772,7 @@ void QCoapProtocolPrivate::registerExchange(const QCoapToken &token, QCoapReply QSharedPointer request) { CoapExchangeData data = { reply, request, - QVector >() + QList >() }; exchangeMap.insert(token, data); diff --git a/src/coap/qcoapprotocol_p.h b/src/coap/qcoapprotocol_p.h index 0e3d3ed..b1cedc1 100644 --- a/src/coap/qcoapprotocol_p.h +++ b/src/coap/qcoapprotocol_p.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -107,7 +107,7 @@ private: struct CoapExchangeData { QPointer userReply; QSharedPointer request; - QVector > replies; + QList > replies; }; typedef QMap CoapExchangeMap; @@ -144,7 +144,7 @@ public: QCoapInternalRequest *requestForToken(const QCoapToken &token) const; QPointer userReplyForToken(const QCoapToken &token) const; - QVector> repliesForToken(const QCoapToken &token) const; + QList> repliesForToken(const QCoapToken &token) const; QCoapInternalReply *lastReplyForToken(const QCoapToken &token) const; QCoapInternalRequest *findRequestByMessageId(quint16 messageId) const; QCoapInternalRequest *findRequestByUserReply(const QCoapReply *reply) const; diff --git a/src/coap/qcoapresourcediscoveryreply.cpp b/src/coap/qcoapresourcediscoveryreply.cpp index c709331..fede3f5 100644 --- a/src/coap/qcoapresourcediscoveryreply.cpp +++ b/src/coap/qcoapresourcediscoveryreply.cpp @@ -89,7 +89,7 @@ void QCoapResourceDiscoveryReplyPrivate::_q_setContent(const QHostAddress &sende /*! \fn void QCoapResourceDiscoveryReply::discovered(QCoapResourceDiscoveryReply *reply, - QVector resources); + QList resources); This signal is emitted whenever a CoAP resource is discovered. @@ -113,7 +113,7 @@ QCoapResourceDiscoveryReply::QCoapResourceDiscoveryReply(const QCoapRequest &req /*! Returns the list of resources. */ -QVector QCoapResourceDiscoveryReply::resources() const +QList QCoapResourceDiscoveryReply::resources() const { Q_D(const QCoapResourceDiscoveryReply); return d->resources; @@ -126,11 +126,11 @@ QVector QCoapResourceDiscoveryReply::resources() const objects. The \a data byte array contains the frame returned by the discovery request. */ -QVector +QList QCoapResourceDiscoveryReplyPrivate::resourcesFromCoreLinkList(const QHostAddress &sender, const QByteArray &data) { - QVector resourceList; + QList resourceList; QLatin1String quote = QLatin1String("\""); const QList links = data.split(','); diff --git a/src/coap/qcoapresourcediscoveryreply.h b/src/coap/qcoapresourcediscoveryreply.h index bd575e0..4e6e638 100644 --- a/src/coap/qcoapresourcediscoveryreply.h +++ b/src/coap/qcoapresourcediscoveryreply.h @@ -43,10 +43,10 @@ class Q_COAP_EXPORT QCoapResourceDiscoveryReply : public QCoapReply Q_OBJECT public: - QVector resources() const; + QList resources() const; Q_SIGNALS: - void discovered(QCoapResourceDiscoveryReply *reply, QVector resources); + void discovered(QCoapResourceDiscoveryReply *reply, QList resources); private: explicit QCoapResourceDiscoveryReply(const QCoapRequest &request, QObject *parent = nullptr); diff --git a/src/coap/qcoapresourcediscoveryreply_p.h b/src/coap/qcoapresourcediscoveryreply_p.h index d074dbf..9e46592 100644 --- a/src/coap/qcoapresourcediscoveryreply_p.h +++ b/src/coap/qcoapresourcediscoveryreply_p.h @@ -56,10 +56,10 @@ public: void _q_setContent(const QHostAddress &sender, const QCoapMessage &, QtCoap::ResponseCode) override; - static QVector resourcesFromCoreLinkList( + static QList resourcesFromCoreLinkList( const QHostAddress &sender, const QByteArray &data); - QVector resources; + QList resources; Q_DECLARE_PUBLIC(QCoapResourceDiscoveryReply) }; diff --git a/src/coap/qcoapsecurityconfiguration.cpp b/src/coap/qcoapsecurityconfiguration.cpp index c9dba57..01f4aea 100644 --- a/src/coap/qcoapsecurityconfiguration.cpp +++ b/src/coap/qcoapsecurityconfiguration.cpp @@ -29,9 +29,9 @@ #include "qcoapsecurityconfiguration.h" -#include #include #include +#include #include QT_BEGIN_NAMESPACE @@ -52,8 +52,8 @@ public: QByteArray identity; QByteArray preSharedKey; QString defaultCipherString; - QVector caCertificates; - QVector localCertificateChain; + QList caCertificates; + QList localCertificateChain; QCoapPrivateKey privateKey; }; @@ -333,7 +333,7 @@ QString QCoapSecurityConfiguration::defaultCipherString() const \sa caCertificates() */ -void QCoapSecurityConfiguration::setCaCertificates(const QVector &certificates) +void QCoapSecurityConfiguration::setCaCertificates(const QList &certificates) { d->caCertificates = certificates; } @@ -343,7 +343,7 @@ void QCoapSecurityConfiguration::setCaCertificates(const QVector QCoapSecurityConfiguration::caCertificates() const +QList QCoapSecurityConfiguration::caCertificates() const { return d->caCertificates; } @@ -354,7 +354,7 @@ QVector QCoapSecurityConfiguration::caCertificates() const \sa localCertificateChain() */ -void QCoapSecurityConfiguration::setLocalCertificateChain(const QVector &localChain) +void QCoapSecurityConfiguration::setLocalCertificateChain(const QList &localChain) { d->localCertificateChain = localChain; } @@ -364,7 +364,7 @@ void QCoapSecurityConfiguration::setLocalCertificateChain(const QVector QCoapSecurityConfiguration::localCertificateChain() const +QList QCoapSecurityConfiguration::localCertificateChain() const { return d->localCertificateChain; } diff --git a/src/coap/qcoapsecurityconfiguration.h b/src/coap/qcoapsecurityconfiguration.h index f935b5e..7dd2d9c 100644 --- a/src/coap/qcoapsecurityconfiguration.h +++ b/src/coap/qcoapsecurityconfiguration.h @@ -95,11 +95,11 @@ public: void setDefaultCipherString(const QString &cipherString); QString defaultCipherString() const; - void setCaCertificates(const QVector &certificates); - QVector caCertificates() const; + void setCaCertificates(const QList &certificates); + QList caCertificates() const; - void setLocalCertificateChain(const QVector &localChain); - QVector localCertificateChain() const; + void setLocalCertificateChain(const QList &localChain); + QList localCertificateChain() const; void setPrivateKey(const QCoapPrivateKey &key); QCoapPrivateKey privateKey() const; diff --git a/tests/auto/qcoapclient/tst_qcoapclient.cpp b/tests/auto/qcoapclient/tst_qcoapclient.cpp index 795da58..fc2b919 100644 --- a/tests/auto/qcoapclient/tst_qcoapclient.cpp +++ b/tests/auto/qcoapclient/tst_qcoapclient.cpp @@ -545,8 +545,8 @@ void tst_QCoapClient::multipleRequests() QSignalSpy spyClientFinished(&client, &QCoapClient::finished); const uint8_t requestCount = 4; - QVector> replies; - QVector> signalSpies; + QList> replies; + QList> signalSpies; for (uint8_t i = 0; i < requestCount; ++i) { QCoapRequest request; const auto token = "token" + QByteArray::number(i); diff --git a/tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp b/tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp index d1c53e3..fb6853d 100644 --- a/tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp +++ b/tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp @@ -169,15 +169,15 @@ void tst_QCoapInternalRequest::requestToFrame() void tst_QCoapInternalRequest::parseUri_data() { - qRegisterMetaType>(); + qRegisterMetaType>(); QTest::addColumn("uri"); QTest::addColumn("proxyUri"); - QTest::addColumn>("options"); + QTest::addColumn>("options"); QTest::newRow("port_path") << QUrl("coap://10.20.30.40:1234/test/path1") << QUrl() - << QVector({ + << QList({ QCoapOption(QCoapOption::UriPort, 1234), QCoapOption(QCoapOption::UriPath, QByteArray("test")), QCoapOption(QCoapOption::UriPath, QByteArray("path1")) }); @@ -185,7 +185,7 @@ void tst_QCoapInternalRequest::parseUri_data() QTest::newRow("path_query") << QUrl("coap://10.20.30.40/test/path1/?rd=25&nd=4") << QUrl() - << QVector({ + << QList({ QCoapOption(QCoapOption::UriPath, QByteArray("test")), QCoapOption(QCoapOption::UriPath, QByteArray("path1")), QCoapOption(QCoapOption::UriQuery, QByteArray("rd=25")), @@ -194,7 +194,7 @@ void tst_QCoapInternalRequest::parseUri_data() QTest::newRow("host_path_query") << QUrl("coap://aa.bb.cc.com:5683/test/path1/?rd=25&nd=4") << QUrl() - << QVector({ + << QList({ QCoapOption(QCoapOption::UriHost, QByteArray("aa.bb.cc.com")), QCoapOption(QCoapOption::UriPath, QByteArray("test")), QCoapOption(QCoapOption::UriPath, QByteArray("path1")), @@ -204,7 +204,7 @@ void tst_QCoapInternalRequest::parseUri_data() QTest::newRow("proxy_url") << QUrl("coap://aa.bb.cc.com:5683/test/path1/?rd=25&nd=4") << QUrl("coap://10.20.30.40/test:5684/othertest/path") - << QVector({ + << QList({ QCoapOption(QCoapOption::ProxyUri, QByteArray("coap://10.20.30.40/test:5684/othertest/path")) }); } @@ -213,7 +213,7 @@ void tst_QCoapInternalRequest::parseUri() { QFETCH(QUrl, uri); QFETCH(QUrl, proxyUri); - QFETCH(QVector, options); + QFETCH(QList, options); QCoapRequest request(uri, QCoapMessage::Type::NonConfirmable, proxyUri); QCoapInternalRequest internalRequest(request); @@ -227,9 +227,9 @@ void tst_QCoapInternalRequest::parseUri() void tst_QCoapInternalRequest::urlOptions_data() { QTest::addColumn("url"); - QTest::addColumn>("options"); + QTest::addColumn>("options"); - QVector options = { + QList options = { { QCoapOption::UriHost, QByteArray("example.com") }, { QCoapOption::UriPath, QByteArray("~sensors") }, { QCoapOption::UriPath, QByteArray("temp.xml") } @@ -257,7 +257,7 @@ void tst_QCoapInternalRequest::urlOptions_data() void tst_QCoapInternalRequest::urlOptions() { QFETCH(QString, url); - QFETCH(QVector, options); + QFETCH(QList, options); const QCoapRequest request(url); const QCoapInternalRequest internalRequest(request); diff --git a/tests/auto/qcoapmessage/tst_qcoapmessage.cpp b/tests/auto/qcoapmessage/tst_qcoapmessage.cpp index 56579e5..05f5a20 100644 --- a/tests/auto/qcoapmessage/tst_qcoapmessage.cpp +++ b/tests/auto/qcoapmessage/tst_qcoapmessage.cpp @@ -129,13 +129,13 @@ void tst_QCoapMessage::addOption() void tst_QCoapMessage::addOption_string_data() { - QTest::addColumn>("options"); + QTest::addColumn>("options"); - QVector single_string_option = { { QCoapOption::LocationPath, QString("path1") } }; - QVector single_ba_option = { + QList single_string_option = { { QCoapOption::LocationPath, QString("path1") } }; + QList single_ba_option = { { QCoapOption::LocationPath, QByteArray("\xAF\x01\xC2") } }; - QVector multiple_string_options = { + QList multiple_string_options = { { QCoapOption::LocationPath, QString("str_path2") }, { QCoapOption::LocationPath, QString("str_path3") } }; @@ -147,7 +147,7 @@ void tst_QCoapMessage::addOption_string_data() void tst_QCoapMessage::addOption_string() { - QFETCH(QVector, options); + QFETCH(QList, options); QCoapMessage message; for (const auto& option : options) @@ -190,10 +190,10 @@ void tst_QCoapMessage::addOption_uint() void tst_QCoapMessage::removeOption_data() { - QTest::addColumn>("options"); + QTest::addColumn>("options"); - QVector single_option = { { QCoapOption::LocationPath, QByteArray("path1") } }; - QVector multiple_options = { + QList single_option = { { QCoapOption::LocationPath, QByteArray("path1") } }; + QList multiple_options = { { QCoapOption::LocationPath, QByteArray("path2") }, { QCoapOption::LocationPath, QByteArray("path3") } }; @@ -204,7 +204,7 @@ void tst_QCoapMessage::removeOption_data() void tst_QCoapMessage::removeOption() { - QFETCH(QVector, options); + QFETCH(QList, options); QCoapMessage message; for (const auto& option : options) @@ -224,11 +224,11 @@ void tst_QCoapMessage::removeOption() void tst_QCoapMessage::removeOptionByName_data() { - QTest::addColumn>("options"); + QTest::addColumn>("options"); QTest::addColumn("name"); - QVector single_option = { { QCoapOption::LocationPath, QByteArray("path1") } }; - QVector multiple_options = { + QList single_option = { { QCoapOption::LocationPath, QByteArray("path1") } }; + QList multiple_options = { { QCoapOption::LocationPath, QByteArray("path2") }, { QCoapOption::LocationPath, QByteArray("path3") } }; @@ -239,7 +239,7 @@ void tst_QCoapMessage::removeOptionByName_data() void tst_QCoapMessage::removeOptionByName() { - QFETCH(QVector, options); + QFETCH(QList, options); QFETCH(QCoapOption::OptionName, name); QCoapMessage message; diff --git a/tests/auto/qcoapresource/tst_qcoapresource.cpp b/tests/auto/qcoapresource/tst_qcoapresource.cpp index 52743ee..dc74798 100644 --- a/tests/auto/qcoapresource/tst_qcoapresource.cpp +++ b/tests/auto/qcoapresource/tst_qcoapresource.cpp @@ -146,7 +146,7 @@ void tst_QCoapResource::parseCoreLink() QFETCH(QList, observableList); QFETCH(QByteArray, coreLinkList); - const QVector resourceList = + const auto resourceList = QCoapResourceDiscoveryReplyPrivate::resourcesFromCoreLinkList( QHostAddress(senderAddress), coreLinkList);