File indexing completed on 2024-04-14 14:13:55
0001 /*************************************************************************** 0002 File : MQTTUnitTest.h 0003 Project : LabPlot 0004 Description : Tests for MQTT related features 0005 -------------------------------------------------------------------- 0006 Copyright : (C) 2018 Kovacs Ferencz (kferike98@gmail.com) 0007 ***************************************************************************/ 0008 0009 /*************************************************************************** 0010 * * 0011 * This program is free software; you can redistribute it and/or modify * 0012 * it under the terms of the GNU General Public License as published by * 0013 * the Free Software Foundation; either version 2 of the License, or * 0014 * (at your option) any later version. * 0015 * * 0016 * This program is distributed in the hope that it will be useful, * 0017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0019 * GNU General Public License for more details. * 0020 * * 0021 * You should have received a copy of the GNU General Public License * 0022 * along with this program; if not, write to the Free Software * 0023 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 0024 * Boston, MA 02110-1301 USA * 0025 * * 0026 ***************************************************************************/ 0027 #ifndef MQTTUNITTEST_H 0028 #define MQTTUNITTEST_H 0029 0030 #include <QtTest> 0031 0032 class MQTTUnitTest : public QObject { 0033 #ifdef HAVE_MQTT 0034 Q_OBJECT 0035 0036 private slots: 0037 void initTestCase(); 0038 0039 //check superior and inferior relations 0040 void testContainFalse(); 0041 void testContainTrue(); 0042 0043 //check common topics 0044 void testCommonTrue(); 0045 void testCommonFalse(); 0046 0047 //test for different tipes of messages 0048 void testIntegerMessage(); 0049 void testNumericMessage(); 0050 void testTextMessage(); 0051 0052 //test subscribing and unsubscribing 0053 void testSubscriptions(); 0054 0055 0056 0057 private: 0058 QString m_dataDir; 0059 #endif //HAVE_MQTT 0060 }; 0061 0062 #endif