File indexing completed on 2024-10-06 09:33:38

0001 /*
0002  * SPDX-FileCopyrightText: 2014-2015 David Rosca <nowrep@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 DEVICETEST_H
0008 #define DEVICETEST_H
0009 
0010 #include <QList>
0011 #include <QObject>
0012 
0013 #include "bluezdevice1_tst.h"
0014 #include "dbusproperties_tst.h"
0015 
0016 #include "adapter.h"
0017 #include "device.h"
0018 #include "manager.h"
0019 
0020 class DeviceTest : public QObject
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     explicit DeviceTest();
0026 
0027 private Q_SLOTS:
0028     void initTestCase();
0029     void cleanupTestCase();
0030 
0031     void getPropertiesTest();
0032     void setAliasTest();
0033     void setTrustedTest();
0034     void setBlockedTest();
0035 
0036     void deviceRemovedTest();
0037 
0038 private:
0039     struct DeviceUnit {
0040         BluezQt::DevicePtr device;
0041         org::bluez::Device1 *dbusDevice;
0042         org::freedesktop::DBus::Properties *dbusProperties;
0043     };
0044 
0045     QString deviceIcon(org::bluez::Device1 *device) const;
0046     qint16 deviceRssi(org::bluez::Device1 *device) const;
0047 
0048     BluezQt::Manager *m_manager;
0049     QList<DeviceUnit> m_units;
0050 };
0051 
0052 #endif // DEVICETEST_H