mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Minor tweaks around formatting, comments, renaming, warnings
This commit is contained in:
@@ -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<class T> void addValue(int index, const T &value)
|
||||
{
|
||||
this->m_values.insert(index, QVariant::fromValue(value));
|
||||
}
|
||||
template<class T> 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(); }
|
||||
|
||||
@@ -15,6 +15,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
CBlackMiscTestMain::unitMain(argc, argv);
|
||||
Q_UNUSED(a);
|
||||
|
||||
// bye
|
||||
return 0;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user