diff --git a/src/blackmisc/indexvariantmap.h b/src/blackmisc/indexvariantmap.h index 36bba0c10..4d3ec3de6 100644 --- a/src/blackmisc/indexvariantmap.h +++ b/src/blackmisc/indexvariantmap.h @@ -35,10 +35,7 @@ namespace BlackMisc CIndexVariantMap(int index, const QVariant &value); //! \copydoc CValueObject::toQVariant - virtual QVariant toQVariant() const override - { - return QVariant::fromValue(*this); - } + virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); } //! Destructor virtual ~CIndexVariantMap() {} @@ -47,10 +44,7 @@ namespace BlackMisc void addValue(int index, const QVariant &value); //! Add a value as non QVariant - template void addValue(int index, const T &value) - { - this->m_values.insert(index, QVariant::fromValue(value)); - } + template void addValue(int index, const T &value) { this->m_values.insert(index, QVariant::fromValue(value)); } //! Is empty? bool isEmpty() const { return this->m_values.isEmpty(); } diff --git a/tests/blackmisc/main.cpp b/tests/blackmisc/main.cpp index 2b984ca43..ff8f132da 100644 --- a/tests/blackmisc/main.cpp +++ b/tests/blackmisc/main.cpp @@ -15,6 +15,7 @@ int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); CBlackMiscTestMain::unitMain(argc, argv); + Q_UNUSED(a); // bye return 0; diff --git a/tests/blackmisc/testblackmiscmain.cpp b/tests/blackmisc/testblackmiscmain.cpp index c6dab2ca1..432eb59cc 100644 --- a/tests/blackmisc/testblackmiscmain.cpp +++ b/tests/blackmisc/testblackmiscmain.cpp @@ -26,14 +26,14 @@ namespace BlackMiscTest CTestVectorMatrix vmTests; CTestGeo geoTests; CTestContainers containerTests; - CTestVariantAndValueMap variantAndValueMap; + CTestVariantAndMap variantAndMap; CTestHardware hardwareTests; status |= QTest::qExec(&pqBaseTests, argc, argv); status |= QTest::qExec(&avBaseTests, argc, argv); status |= QTest::qExec(&vmTests, argc, argv); status |= QTest::qExec(&geoTests, argc, argv); status |= QTest::qExec(&containerTests, argc, argv); - status |= QTest::qExec(&variantAndValueMap, argc, argv); + status |= QTest::qExec(&variantAndMap, argc, argv); status |= QTest::qExec(&hardwareTests, argc, argv); } return status; diff --git a/tests/blackmisc/testblackmiscmain.h b/tests/blackmisc/testblackmiscmain.h index 8955ccdd7..dad20bf40 100644 --- a/tests/blackmisc/testblackmiscmain.h +++ b/tests/blackmisc/testblackmiscmain.h @@ -11,22 +11,22 @@ namespace BlackMiscTest { -/*! - * Class firing all unit tests in this namespace. - * Avoids clashes with other main(..) functions and allows to fire the test cases - * simply from any other main. - */ -class CBlackMiscTestMain -{ -public: /*! - * \brief Starting all - * \param argc - * \param argv - * \return + * Class firing all unit tests in this namespace. + * Avoids clashes with other main(..) functions and allows to fire the test cases + * simply from any other main. */ - static int unitMain(int argc, char *argv[]); -}; + class CBlackMiscTestMain + { + public: + /*! + * \brief Starting all + * \param argc + * \param argv + * \return + */ + static int unitMain(int argc, char *argv[]); + }; } #endif // guard diff --git a/tests/blackmisc/testvariantandmap.cpp b/tests/blackmisc/testvariantandmap.cpp index c00877e8d..fcc9df8b8 100644 --- a/tests/blackmisc/testvariantandmap.cpp +++ b/tests/blackmisc/testvariantandmap.cpp @@ -22,7 +22,7 @@ namespace BlackMiscTest /* * Variant tests */ - void CTestVariantAndValueMap::variant() + void CTestVariantAndMap::variant() { // ATC station QDateTime dtFrom = QDateTime::currentDateTimeUtc(); @@ -71,9 +71,9 @@ namespace BlackMiscTest } /* - * Value map tests + * Variant map tests */ - void CTestVariantAndValueMap::valueMap() + void CTestVariantAndMap::valueMap() { // ATC station QDateTime dtFrom = QDateTime::currentDateTimeUtc(); @@ -100,4 +100,4 @@ namespace BlackMiscTest QVERIFY2(vmWildcard == vmWildcard, "Maps should be equal"); } -} //namespace BlackMiscTest +} // namespace diff --git a/tests/blackmisc/testvariantandmap.h b/tests/blackmisc/testvariantandmap.h index 05a6aa277..50e30c9e5 100644 --- a/tests/blackmisc/testvariantandmap.h +++ b/tests/blackmisc/testvariantandmap.h @@ -3,8 +3,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef BLACKMISCTEST_TESTVARIANTANDVALUEMAP_H -#define BLACKMISCTEST_TESTVARIANTANDVALUEMAP_H +#ifndef BLACKMISCTEST_TESTVARIANTANDMAP_H +#define BLACKMISCTEST_TESTVARIANTANDMAP_H #include "blackmisc/pqconstants.h" #include "blackmisc/avatcstation.h" @@ -14,29 +14,21 @@ namespace BlackMiscTest { /*! - * \brief Aviation classes basic tests + * \brief Variant and map related tests */ - class CTestVariantAndValueMap : public QObject + class CTestVariantAndMap : public QObject { Q_OBJECT public: - /*! - * \brief Standard test case constructor - * \param parent - */ - explicit CTestVariantAndValueMap(QObject *parent = 0) : QObject(parent) {} + //! Standard test case constructor + explicit CTestVariantAndMap(QObject *parent = nullptr) : QObject(parent) {} private slots: - /*! - * \brief Basic unit tests for value objects and variants - */ + //! Basic unit tests for value objects and variants void variant(); - /*! - * \brief Unit tests for value maps and value objects - */ + //! Unit tests for value maps and value objects void valueMap(); - }; } // namespace diff --git a/tests/blackmisc/testvectormatrix.h b/tests/blackmisc/testvectormatrix.h index 616e5fbd5..5f8eddc90 100644 --- a/tests/blackmisc/testvectormatrix.h +++ b/tests/blackmisc/testvectormatrix.h @@ -12,31 +12,24 @@ namespace BlackMiscTest { -/*! - * \brief Vector and Matrix classes tests - */ -class CTestVectorMatrix : public QObject -{ - Q_OBJECT - -public: /*! - * \brief Standard test case constructor - * \param parent + * \brief Vector and Matrix classes tests */ - explicit CTestVectorMatrix(QObject *parent = 0) : QObject(parent) {} + class CTestVectorMatrix : public QObject + { + Q_OBJECT -private slots: - /*! - * \brief Basic unit tests for physical units - */ - void vectorBasics(); + public: + //! Standard test case constructor + explicit CTestVectorMatrix(QObject *parent = nullptr) : QObject(parent) {} - /*! - * \brief Vertical positions - */ - void matrixBasics(); -}; + private slots: + //! Vector tests + void vectorBasics(); + + //! Matrix tests + void matrixBasics(); + }; } // namespace