MCPcopy Create free account
hub / github.com/KDE/labplot / testCommonTrue

Method testCommonTrue

tests/import_export/MQTT/MQTTTest.cpp:102–119  ·  view source on GitHub ↗

############################################################################## ############################ check common topics ########################### ##############################################################################

Source from the content-addressed store, hash-verified

100// ############################ check common topics ###########################
101// ##############################################################################
102void MQTTTest::testCommonTrue() {
103 auto* client = new MQTTClient(QStringLiteral("test"));
104 const QString fileName = m_dataDir + QStringLiteral("common_true.txt");
105 QFile file(fileName);
106
107 if (file.open(QIODevice::ReadOnly)) {
108 QTextStream in(&file);
109
110 while (!in.atEnd()) {
111 QString line = in.readLine();
112 auto topics = line.split(QLatin1Char(' '), Qt::SkipEmptyParts);
113 QCOMPARE(client->checkCommonLevel(topics[0], topics[1]), topics[2]);
114 }
115
116 delete client;
117 file.close();
118 }
119}
120
121void MQTTTest::testCommonFalse() {
122 auto* client = new MQTTClient(QStringLiteral("test"));

Callers

nothing calls this directly

Calls 5

atEndMethod · 0.80
splitMethod · 0.80
openMethod · 0.45
checkCommonLevelMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected