File indexing completed on 2024-06-16 10:43:47

0001 // SPDX-FileCopyrightText: Lukas Sommer <sommerluk@gmail.com>
0002 // SPDX-License-Identifier: BSD-2-Clause OR MIT
0003 
0004 // First included header is the public header of the class we are testing;
0005 // this forces the header to be self-contained.
0006 #include "helperqttypes.h"
0007 
0008 #include <qglobal.h>
0009 #include <qobject.h>
0010 #include <qtest.h>
0011 #include <qtestcase.h>
0012 #include <type_traits>
0013 
0014 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
0015 #include <qtmetamacros.h>
0016 #else
0017 #include <qobjectdefs.h>
0018 #include <qstring.h>
0019 #endif
0020 
0021 namespace PerceptualColor
0022 {
0023 
0024 class TestHelperQtTypes : public QObject
0025 {
0026     Q_OBJECT
0027 
0028 public:
0029     explicit TestHelperQtTypes(QObject *parent = nullptr)
0030         : QObject(parent)
0031     {
0032     }
0033 
0034 private Q_SLOTS:
0035 
0036     void initTestCase()
0037     {
0038         // Called before the first test function is executed
0039     }
0040 
0041     void cleanupTestCase()
0042     {
0043         // Called after the last test function was executed
0044     }
0045 
0046     void init()
0047     {
0048         // Called before each test function is executed
0049     }
0050     void cleanup()
0051     {
0052         // Called after every test function
0053     }
0054 
0055     void testQColorFloatType()
0056     {
0057         QVERIFY(std::is_floating_point_v<QColorFloatType>);
0058     }
0059 
0060     void testQListSizeType()
0061     {
0062         QVERIFY(std::is_integral_v<QListSizeType>);
0063     }
0064 };
0065 
0066 } // namespace PerceptualColor
0067 
0068 QTEST_MAIN(PerceptualColor::TestHelperQtTypes)
0069 // The following “include” is necessary because we do not use a header file:
0070 #include "testhelperqttypes.moc"