aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2020-06-23 17:04:59 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2020-06-24 23:39:38 +0200
commita0ab76a6f505fe6cf0e8f08a3166bb9e145596ce (patch)
treebbae0bf03d35c08fcb1c651b83cf0287daa73376 /tests
parent040798729644237e5bb47e346a66b68a86ea445b (diff)
Use QList instead of QVector in qtcoap
And fix dependencies. Task-number: QTBUG-84469 Change-Id: Ic68bcf0229b516a04ba3d9e515dfb992e12d1f49 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qcoapclient/tst_qcoapclient.cpp4
-rw-r--r--tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp20
-rw-r--r--tests/auto/qcoapmessage/tst_qcoapmessage.cpp26
-rw-r--r--tests/auto/qcoapresource/tst_qcoapresource.cpp2
4 files changed, 26 insertions, 26 deletions
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<QSharedPointer<QCoapReply>> replies;
- QVector<QSharedPointer<QSignalSpy>> signalSpies;
+ QList<QSharedPointer<QCoapReply>> replies;
+ QList<QSharedPointer<QSignalSpy>> 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<QVector<QCoapOption>>();
+ qRegisterMetaType<QList<QCoapOption>>();
QTest::addColumn<QUrl>("uri");
QTest::addColumn<QUrl>("proxyUri");
- QTest::addColumn<QVector<QCoapOption>>("options");
+ QTest::addColumn<QList<QCoapOption>>("options");
QTest::newRow("port_path")
<< QUrl("coap://10.20.30.40:1234/test/path1")
<< QUrl()
- << QVector<QCoapOption>({
+ << QList<QCoapOption>({
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<QCoapOption>({
+ << QList<QCoapOption>({
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<QCoapOption>({
+ << QList<QCoapOption>({
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<QCoapOption>({
+ << QList<QCoapOption>({
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<QCoapOption>, options);
+ QFETCH(QList<QCoapOption>, 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<QString>("url");
- QTest::addColumn<QVector<QCoapOption>>("options");
+ QTest::addColumn<QList<QCoapOption>>("options");
- QVector<QCoapOption> options = {
+ QList<QCoapOption> 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<QCoapOption>, options);
+ QFETCH(QList<QCoapOption>, 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<QVector<QCoapOption>>("options");
+ QTest::addColumn<QList<QCoapOption>>("options");
- QVector<QCoapOption> single_string_option = { { QCoapOption::LocationPath, QString("path1") } };
- QVector<QCoapOption> single_ba_option = {
+ QList<QCoapOption> single_string_option = { { QCoapOption::LocationPath, QString("path1") } };
+ QList<QCoapOption> single_ba_option = {
{ QCoapOption::LocationPath, QByteArray("\xAF\x01\xC2") }
};
- QVector<QCoapOption> multiple_string_options = {
+ QList<QCoapOption> 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<QCoapOption>, options);
+ QFETCH(QList<QCoapOption>, options);
QCoapMessage message;
for (const auto& option : options)
@@ -190,10 +190,10 @@ void tst_QCoapMessage::addOption_uint()
void tst_QCoapMessage::removeOption_data()
{
- QTest::addColumn<QVector<QCoapOption>>("options");
+ QTest::addColumn<QList<QCoapOption>>("options");
- QVector<QCoapOption> single_option = { { QCoapOption::LocationPath, QByteArray("path1") } };
- QVector<QCoapOption> multiple_options = {
+ QList<QCoapOption> single_option = { { QCoapOption::LocationPath, QByteArray("path1") } };
+ QList<QCoapOption> 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<QCoapOption>, options);
+ QFETCH(QList<QCoapOption>, options);
QCoapMessage message;
for (const auto& option : options)
@@ -224,11 +224,11 @@ void tst_QCoapMessage::removeOption()
void tst_QCoapMessage::removeOptionByName_data()
{
- QTest::addColumn<QVector<QCoapOption>>("options");
+ QTest::addColumn<QList<QCoapOption>>("options");
QTest::addColumn<QCoapOption::OptionName>("name");
- QVector<QCoapOption> single_option = { { QCoapOption::LocationPath, QByteArray("path1") } };
- QVector<QCoapOption> multiple_options = {
+ QList<QCoapOption> single_option = { { QCoapOption::LocationPath, QByteArray("path1") } };
+ QList<QCoapOption> 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<QCoapOption>, options);
+ QFETCH(QList<QCoapOption>, 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<bool>, observableList);
QFETCH(QByteArray, coreLinkList);
- const QVector<QCoapResource> resourceList =
+ const auto resourceList =
QCoapResourceDiscoveryReplyPrivate::resourcesFromCoreLinkList(
QHostAddress(senderAddress), coreLinkList);