QCoapReply is a QIODevice, but it was not obvious if readData() is
implemented properly, or if it also needed to update pos().
This patch adds a unit test that checks a chunked read from the reply.
The test passes, so nothing needs to be fixed in the implementation.
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: I0642718f21a31cf978a733bc3bc742ad1eb47b3a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is the result of running util/normalize on the code base. The
following manual edits were needed:
(none)
Pick-to: 6.10 6.9 6.8 6.5
Change-Id: Ia18b3968bc164a8dce5e7cca7653c759646cc4da
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
According to QUIP-18 [1], all tools file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
[1]: https://contribute.qt-project.org/quips/18
Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: If7b3daf5cc2be069ab205bf10cdf653ab9d6c415
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
The californium docker container is updated, and now provides a
different binary to run.
This patch adjusts the tests and docker script:
* update the docker script to call the proper binary
* update the number of resources exposed by the californium server
* update the expected returned tokens to be uppercase
Task-number: QTBUG-114798
Pick-to: 6.6 6.5
Change-Id: I733793cc472769e433144a08b8f02f0120f6f29b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
Add the boilerplate standalone test prelude to each test, so that they
can be opened with an IDE without the qt-cmake-standalone-test script,
but directly with qt-cmake or cmake.
Boilerplate was added using the following scripts:
https://git.qt.io/alcroito/cmake_refactor
Manual adjustments were made where the code was inserted in the wrong
location.
Task-number: QTBUG-93020
Change-Id: Idc25fe2da6e4d6dbefa9fc669401e127beec2ae4
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
As we are now processing the arguments with
cmake_parse_arguments(PARSE_ARGV, we don't need to pass the escape
characters anymore.
Task-number: QTBUG-99238
Change-Id: Iba8f0321838aa41b9b34e0a9766ada89b2a5c38b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I0483bd72018332f9a1d7c60537228ea6c85f7029
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:
auto QtContainerClass = anyOf(
expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.
Change-Id: I227e49052f5f1a2a8abfc719112facb5c805d463
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.
Existing copyright statements remain intact
Task-number: QTBUG-88621
Change-Id: I53217bc6cf8a044937785533ec42ce22d6720a49
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I2f390c365ce2d50aa79d317eafd63be19e530c1e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Needed for subsequent change that will check and error out if the
version is lower than 3.16. We do that to ensure all policies
introduced by CMake up to version 3.16 have their behavior set to
NEW.
Pick-to: 6.2
Task-number: QTBUG-95018
Change-Id: Ibafb41a5c8f27305b6e5cb29a6543d0779e0dcf2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
When sending Acknowledgment packets with code 0.00, the message should
be empty (RFC-7252 section 12.1). An empty message should have no token
(token length is 0), and no bytes should appear after the message ID
(RFC-7252 section 4.1, section 3). Since Reset packets have the same
structure (only the packet type differs), unified the packet creation
for both cases in one method.
Fixes: QTBUG-94763
Pick-to: 6.2 6.1 5.15
Change-Id: If2619ad6f4f5dba500e04ab10dbbbf08e4887aef
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Setting the QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS variable
in the project ensures we ported away from old API calls.
Task-number: QTBUG-86815
Change-Id: I034cce0921b65bf635c1d16a408bbd7141efe4a0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The build failing after d7ccd8cb4565c8643b158891c9de3187c1586dc9 and
update dependencies.yaml.
Fixes: QTBUG-85896
Change-Id: I52e4dfea4edf0b96de3387f36168bbd18b1cf097
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
The tst_QCoapClient::socketError was failing because it was using the
old signal connection syntax and as a result a non-existing signal. Fixed
the connection syntax in other places as well.
Additionally fixed a few unrelated warnings.
Change-Id: Ie8ab95551d945d3991debfc628497515894d539e
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
When sending POST and PUT requests via overloads taking QCoapRequest and
QByteArray data, the payload of the request will be overwritten by an empty
byte array, if no data has been passed when calling post()/put(). Do
not overwrite the payload of a QCoapRequest, if the data parameter is
empty.
Pick-to: 5.15
Change-Id: Iffa40b00ce841a5cebb09dcf59ea22a2a5f9df50
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
With e4f9ac5607a329bae045567a339d36469bc4fff6 we can now use the
"latest" tag instead of hard-coding the SHA for docker images.
Change-Id: I2cde7a03194fbbd4d2059898ec4394889d5fd3db
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Some tests cases are randomly failing because of the following issues:
- In tst_QCoapClient::removeReply test 'reply' is scheduled for deletion
before calling exec, which causes it to be deleted while the request
is still executing. Schedule it for deletion in the QCoapReply::finished
slot.
- The timeout used in tst_QCoapClient::setMinimumTokenSize sometimes is
not sufficient, increase it.
Fixes: QTBUG-79113
Change-Id: I151380fa4982d8c654550cf64108ab31d9b6f6b2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This is a follow-up on the initial commit of the security tests.
Includes the following changes:
- Fixed the non-secure tests to run when security is not set up.
- Renamed QCoapClientForSecurityTests::securityMissing() to
securitySetupMissing() and added some comments to clarify its
purpose.
See 13d450eff7 for more details.
Change-Id: If9fec1fcf7a1bdb9b20883ad37bf1286c53c1f45
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The blacklists were introduced to make the tests pass on linux
systems where docker is not available. With the current solution
the tests requiring a CoAP server will be skipped if the CoAP
server is not setup. So the blacklists are not needed anymore.
Change-Id: I0bb16bc3905a47699e8d019917917b08ac3eb3d4
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
- Added docker compose files for setting up CoAP test servers.
- Enabled the disabled tests which require a californium-based CoAP
server. These tests are enabled only on linux, since docker-based
testing doesn't work in CI for other platforms. Note, that they
are blacklisted for some linux platforms for the same reason.
Change-Id: Id99f9f67fb2874576524e6452250be5506bdbdf4
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
For security reasons it is recommended to use tokens with a length of
at least 4 bytes. Added a method for setting the minimum token size and
changed it to be 4 by default.
Change-Id: Ib589b338df8e59ccaf24dceab6691f92d92f861c
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Instead of using #ifdefs for the private class tests, conditionally
enable/disable subprojects for them.
Change-Id: I574dc34dd895a4fc2eeb311dfb91a149a6715e28
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This change is based on the feedback from API review.
Change-Id: Ia17d061c60fcf7aa4da38542d96d75ae621f657a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
- The RFC specifies the following option formats: empty, opaque, uint
and string. Leave only the construcors for the specified types.
- Rename value getters to reflect the expected value type.
- Move the internally used setter methods to the private class.
This change is based on the feedback from API review.
Change-Id: I0b482770b9c02e64b0f345384ebf58ec29a7e9bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>