File indexing completed on 2024-04-14 03:49:54

0001 /*
0002  * SPDX-FileCopyrightText: 2021 Ivan Podkurkov <podkiva2@gmail.com>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005  */
0006 
0007 #ifndef GATTDESCRIPTORREMOTETEST_H
0008 #define GATTDESCRIPTORREMOTETEST_H
0009 
0010 #include <QList>
0011 #include <QObject>
0012 
0013 #include "bluezgattdescriptor1_tst.h"
0014 #include "dbusproperties_tst.h"
0015 
0016 #include "gattdescriptorremote.h"
0017 #include "manager.h"
0018 
0019 class GattDescriptorRemoteTest : public QObject
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     explicit GattDescriptorRemoteTest();
0025 
0026 private Q_SLOTS:
0027     void initTestCase();
0028     void cleanupTestCase();
0029 
0030     void getPropertiesTest();
0031     void setHandleTest();
0032 
0033     void readValueTest();
0034     void writeValueTest();
0035 
0036     void descriptorRemovedTest();
0037 
0038 private:
0039     struct GattDescriptorRemoteUnit {
0040         BluezQt::GattDescriptorRemotePtr descriptor;
0041         org::bluez::GattDescriptor1 *dbusDescriptor;
0042         org::freedesktop::DBus::Properties *dbusProperties;
0043     };
0044 
0045     BluezQt::Manager *m_manager;
0046     QList<GattDescriptorRemoteUnit> m_units;
0047 };
0048 
0049 #endif // GATTDESCRIPTORREMOTETEST_H