diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-05-12 22:17:32 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-05-14 15:15:24 +0000 |
commit | 3d10238a8be9cecdf6850791d0520d17e33297a6 (patch) | |
tree | 046c34e413c0fdb81b4bd17b7b7136a7f53f69b9 /tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp | |
parent | 04b0424b8cf1aae3e0d9e8496650ce3329872917 (diff) |
Improve the API of QCoapMessage
- Rename QCoapMessage::MessageType -> QCoapMessage::Type
- Rename option() -> optionAt()
- Rename removeAllOptions() -> clearOptions()
- Hide findOption(). option() is more convenient to use instead.
- Add a setOptions() method.
This change is based on the feedback from API review.
Change-Id: I2093a06ca09eebb95865a82e09d2aa2265379e5d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp')
-rw-r--r-- | tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp b/tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp index 6a61eb1..1e5c732 100644 --- a/tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp +++ b/tests/auto/qcoapinternalrequest/tst_qcoapinternalrequest.cpp @@ -63,7 +63,7 @@ void tst_QCoapInternalRequest::requestToFrame_data() { QTest::addColumn<QUrl>("url"); QTest::addColumn<QtCoap::Method>("method"); - QTest::addColumn<QCoapMessage::MessageType>("type"); + QTest::addColumn<QCoapMessage::Type>("type"); QTest::addColumn<quint16>("messageId"); QTest::addColumn<QByteArray>("token"); QTest::addColumn<QString>("pduHeader"); @@ -72,7 +72,7 @@ void tst_QCoapInternalRequest::requestToFrame_data() QTest::newRow("request_with_option_and_payload") << QUrl("coap://10.20.30.40:5683/test") << QtCoap::Method::Get - << QCoapRequest::MessageType::NonConfirmable + << QCoapRequest::Type::NonConfirmable << quint16(56400) << QByteArray::fromHex("4647f09b") << "5401dc504647f09bb474657374ff" @@ -81,7 +81,7 @@ void tst_QCoapInternalRequest::requestToFrame_data() QTest::newRow("request_domain") << QUrl("coap://domain.com:5683/test") << QtCoap::Method::Get - << QCoapRequest::MessageType::NonConfirmable + << QCoapRequest::Type::NonConfirmable << quint16(56400) << QByteArray::fromHex("4647f09b") << "5401dc504647f09b3a646f6d61696e2e636f6d8474657374ff" @@ -90,7 +90,7 @@ void tst_QCoapInternalRequest::requestToFrame_data() QTest::newRow("request_ipv6") << QUrl("coap://[::ffff:ac11:3]:5683/test") << QtCoap::Method::Get - << QCoapRequest::MessageType::NonConfirmable + << QCoapRequest::Type::NonConfirmable << quint16(56400) << QByteArray::fromHex("4647f09b") << "5401dc504647f09bb474657374ff" @@ -99,7 +99,7 @@ void tst_QCoapInternalRequest::requestToFrame_data() QTest::newRow("request_without_payload") << QUrl("coap://10.20.30.40:5683/test") << QtCoap::Method::Get - << QCoapRequest::MessageType::NonConfirmable + << QCoapRequest::Type::NonConfirmable << quint16(56400) << QByteArray::fromHex("4647f09b") << "5401dc504647f09bb474657374" @@ -108,7 +108,7 @@ void tst_QCoapInternalRequest::requestToFrame_data() QTest::newRow("request_without_option") << QUrl("coap://10.20.30.40:5683/") << QtCoap::Method::Put - << QCoapRequest::MessageType::Confirmable + << QCoapRequest::Type::Confirmable << quint16(56400) << QByteArray::fromHex("4647f09b") << "4403dc504647f09bff" @@ -117,7 +117,7 @@ void tst_QCoapInternalRequest::requestToFrame_data() QTest::newRow("request_only") << QUrl("coap://10.20.30.40:5683/") << QtCoap::Method::Get - << QCoapRequest::MessageType::NonConfirmable + << QCoapRequest::Type::NonConfirmable << quint16(56400) << QByteArray::fromHex("4647f09b") << "5401dc504647f09b" @@ -126,7 +126,7 @@ void tst_QCoapInternalRequest::requestToFrame_data() QTest::newRow("request_with_multiple_options") << QUrl("coap://10.20.30.40:5683/test/oui") << QtCoap::Method::Get - << QCoapRequest::MessageType::NonConfirmable + << QCoapRequest::Type::NonConfirmable << quint16(56400) << QByteArray::fromHex("4647f09b") << "5401dc504647f09bb474657374036f7569" @@ -135,7 +135,7 @@ void tst_QCoapInternalRequest::requestToFrame_data() QTest::newRow("request_with_big_option_number") << QUrl("coap://10.20.30.40:5683/test") << QtCoap::Method::Get - << QCoapRequest::MessageType::NonConfirmable + << QCoapRequest::Type::NonConfirmable << quint16(56400) << QByteArray::fromHex("4647f09b") << "5401dc504647f09bb474657374dd240d6162636465666768696a6b6c6d6e6f70" @@ -147,7 +147,7 @@ void tst_QCoapInternalRequest::requestToFrame() { QFETCH(QUrl, url); QFETCH(QtCoap::Method, method); - QFETCH(QCoapMessage::MessageType, type); + QFETCH(QCoapMessage::Type, type); QFETCH(quint16, messageId); QFETCH(QByteArray, token); QFETCH(QString, pduHeader); @@ -218,7 +218,7 @@ void tst_QCoapInternalRequest::parseUri() QFETCH(QUrl, proxyUri); QFETCH(QVector<QCoapOption>, options); - QCoapRequest request(uri, QCoapMessage::MessageType::NonConfirmable, proxyUri); + QCoapRequest request(uri, QCoapMessage::Type::NonConfirmable, proxyUri); QCoapInternalRequest internalRequest(request); for (QCoapOption opt : options) |