1
0
mirror of https://github.com/qt/qtmqtt.git synced 2026-10-25 16:16:26 +00:00
qtmqtt/tests
Marc Mutz 3368252b0d Tst_QMqttSubscription: fix -Wunused-lambda-capture
Says Clang:

  tst_qmqttsubscription.cpp:515:92: warning: lambda capture 'client' is not used [-Wunused-lambda-capture]
    515 |         connect(subscriptions[i], &QMqttSubscription::messageReceived, subscriptions[i], [&client, topic, &received](QMqttMessage msg) {
        |                                                                                           ~^~~~~~~
  tst_qmqttsubscription.cpp:545:92: warning: lambda capture 'client' is not used [-Wunused-lambda-capture]
    545 |         connect(subscriptions[i], &QMqttSubscription::messageReceived, subscriptions[i], [&client, topic, &received](QMqttMessage msg) {
        |                                                                                           ~^~~~~~~
  tst_qmqttsubscription.cpp:576:92: warning: lambda capture 'client' is not used [-Wunused-lambda-capture]
    576 |         connect(subscriptions[i], &QMqttSubscription::messageReceived, subscriptions[i], [&client, topic, &received](QMqttMessage msg) {
        |                                                                                           ~^~~~~~~

Fix by removing the problematic capture. I don't know why it doesn't
complain about `topic`, which also looks unused.

Amends c383083270 (picked to 6.8).

Pick-to: 6.10 6.8
Change-Id: I52850ae4ff9b5e2faee86cd8252d78ce5f0908ff
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
(cherry picked from commit a3c58404a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2026-03-24 08:37:57 +00:00
..
auto Tst_QMqttSubscription: fix -Wunused-lambda-capture 2026-03-24 08:37:57 +00:00
benchmarks Add tests for websocket support for mqtt 2025-01-29 15:54:55 +01:00
certificate Add tests for websocket support for mqtt 2025-01-29 15:54:55 +01:00
common Implement waitForBytesWritten for the websockets case 2025-09-10 11:39:48 +02:00
libfuzzer/mqtt/data_receive Change license for test files 2024-03-20 08:11:56 +01:00
manual Only call find_package when building tests as standalone 2024-11-28 18:02:17 +01:00
CMakeLists.txt Band-aid patch for overriding mosquitto installation detection 2025-04-11 08:01:20 +00:00
README.txt Add README for using auto tests 2018-02-02 07:59:27 +00:00

The tests included in the subdirectories check for functionality and
conformance of the Qt MQTT module.

To be able to run the tests successfully, a broker needs to be available and
reachable.

The continuous integration utilized the paho conformance test broker. It can
be obtained at this location:
https://github.com/eclipse/paho.mqtt.testing

For the unit tests being able to locate this script, use the
MQTT_TEST_BROKER_LOCATION environment variable and set it
to “<install-path>/interoperability/startbroker.py”.

Alternatively, any broker can be instantiated and passed to the auto tests
by using the environment variable MQTT_TEST_BROKER. This must point to a
valid url. The broker must run on the standardized port 1883.

Note, that the unit tests verify functionality against the MQTT 3.1.1 version
of the standard, hence the broker needs to be compliant to the adherent
specifications.