summaryrefslogtreecommitdiffstats
path: root/tests/common/broker_connection.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/common/broker_connection.h')
-rw-r--r--tests/common/broker_connection.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/common/broker_connection.h b/tests/common/broker_connection.h
index 593690c..32ab147 100644
--- a/tests/common/broker_connection.h
+++ b/tests/common/broker_connection.h
@@ -29,6 +29,7 @@
#include <QtCore/QFile>
#include <QtCore/QProcess>
#include <QtCore/QString>
+#include <QtMqtt/QMqttClient>
#include <QtNetwork/QTcpSocket>
#include <QtTest/QTest>
@@ -98,3 +99,14 @@ QString invokeOrInitializeBroker(QProcess *gBrokerProcess)
qWarning("Could not launch MQTT test broker.");
return QString();
}
+
+Q_DECLARE_METATYPE(QMqttClient::ProtocolVersion)
+#define VersionClient(MQTTVERSION, CLIENTNAME) QMqttClient CLIENTNAME; CLIENTNAME.setProtocolVersion(MQTTVERSION)
+
+#define DefaultVersionTestData(FUNCTION) \
+void FUNCTION() \
+{ \
+ QTest::addColumn<QMqttClient::ProtocolVersion>("mqttVersion"); \
+ QTest::newRow("V3.1.1") << QMqttClient::MQTT_3_1_1; \
+ QTest::newRow("V5.0.0") << QMqttClient::MQTT_5_0; \
+}