mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +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);
|
CIndexVariantMap(int index, const QVariant &value);
|
||||||
|
|
||||||
//! \copydoc CValueObject::toQVariant
|
//! \copydoc CValueObject::toQVariant
|
||||||
virtual QVariant toQVariant() const override
|
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||||
{
|
|
||||||
return QVariant::fromValue(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CIndexVariantMap() {}
|
virtual ~CIndexVariantMap() {}
|
||||||
@@ -47,10 +44,7 @@ namespace BlackMisc
|
|||||||
void addValue(int index, const QVariant &value);
|
void addValue(int index, const QVariant &value);
|
||||||
|
|
||||||
//! Add a value as non QVariant
|
//! Add a value as non QVariant
|
||||||
template<class T> void addValue(int index, const T &value)
|
template<class T> void addValue(int index, const T &value) { this->m_values.insert(index, QVariant::fromValue(value)); }
|
||||||
{
|
|
||||||
this->m_values.insert(index, QVariant::fromValue(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Is empty?
|
//! Is empty?
|
||||||
bool isEmpty() const { return this->m_values.isEmpty(); }
|
bool isEmpty() const { return this->m_values.isEmpty(); }
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
QCoreApplication a(argc, argv);
|
QCoreApplication a(argc, argv);
|
||||||
CBlackMiscTestMain::unitMain(argc, argv);
|
CBlackMiscTestMain::unitMain(argc, argv);
|
||||||
|
Q_UNUSED(a);
|
||||||
|
|
||||||
// bye
|
// bye
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -26,14 +26,14 @@ namespace BlackMiscTest
|
|||||||
CTestVectorMatrix vmTests;
|
CTestVectorMatrix vmTests;
|
||||||
CTestGeo geoTests;
|
CTestGeo geoTests;
|
||||||
CTestContainers containerTests;
|
CTestContainers containerTests;
|
||||||
CTestVariantAndValueMap variantAndValueMap;
|
CTestVariantAndMap variantAndMap;
|
||||||
CTestHardware hardwareTests;
|
CTestHardware hardwareTests;
|
||||||
status |= QTest::qExec(&pqBaseTests, argc, argv);
|
status |= QTest::qExec(&pqBaseTests, argc, argv);
|
||||||
status |= QTest::qExec(&avBaseTests, argc, argv);
|
status |= QTest::qExec(&avBaseTests, argc, argv);
|
||||||
status |= QTest::qExec(&vmTests, argc, argv);
|
status |= QTest::qExec(&vmTests, argc, argv);
|
||||||
status |= QTest::qExec(&geoTests, argc, argv);
|
status |= QTest::qExec(&geoTests, argc, argv);
|
||||||
status |= QTest::qExec(&containerTests, 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);
|
status |= QTest::qExec(&hardwareTests, argc, argv);
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace BlackMiscTest
|
|||||||
/*
|
/*
|
||||||
* Variant tests
|
* Variant tests
|
||||||
*/
|
*/
|
||||||
void CTestVariantAndValueMap::variant()
|
void CTestVariantAndMap::variant()
|
||||||
{
|
{
|
||||||
// ATC station
|
// ATC station
|
||||||
QDateTime dtFrom = QDateTime::currentDateTimeUtc();
|
QDateTime dtFrom = QDateTime::currentDateTimeUtc();
|
||||||
@@ -71,9 +71,9 @@ namespace BlackMiscTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Value map tests
|
* Variant map tests
|
||||||
*/
|
*/
|
||||||
void CTestVariantAndValueMap::valueMap()
|
void CTestVariantAndMap::valueMap()
|
||||||
{
|
{
|
||||||
// ATC station
|
// ATC station
|
||||||
QDateTime dtFrom = QDateTime::currentDateTimeUtc();
|
QDateTime dtFrom = QDateTime::currentDateTimeUtc();
|
||||||
@@ -100,4 +100,4 @@ namespace BlackMiscTest
|
|||||||
QVERIFY2(vmWildcard == vmWildcard, "Maps should be equal");
|
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
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#ifndef BLACKMISCTEST_TESTVARIANTANDVALUEMAP_H
|
#ifndef BLACKMISCTEST_TESTVARIANTANDMAP_H
|
||||||
#define BLACKMISCTEST_TESTVARIANTANDVALUEMAP_H
|
#define BLACKMISCTEST_TESTVARIANTANDMAP_H
|
||||||
|
|
||||||
#include "blackmisc/pqconstants.h"
|
#include "blackmisc/pqconstants.h"
|
||||||
#include "blackmisc/avatcstation.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
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*!
|
//! Standard test case constructor
|
||||||
* \brief Standard test case constructor
|
explicit CTestVariantAndMap(QObject *parent = nullptr) : QObject(parent) {}
|
||||||
* \param parent
|
|
||||||
*/
|
|
||||||
explicit CTestVariantAndValueMap(QObject *parent = 0) : QObject(parent) {}
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/*!
|
//! Basic unit tests for value objects and variants
|
||||||
* \brief Basic unit tests for value objects and variants
|
|
||||||
*/
|
|
||||||
void variant();
|
void variant();
|
||||||
/*!
|
//! Unit tests for value maps and value objects
|
||||||
* \brief Unit tests for value maps and value objects
|
|
||||||
*/
|
|
||||||
void valueMap();
|
void valueMap();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -20,21 +20,14 @@ class CTestVectorMatrix : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*!
|
//! Standard test case constructor
|
||||||
* \brief Standard test case constructor
|
explicit CTestVectorMatrix(QObject *parent = nullptr) : QObject(parent) {}
|
||||||
* \param parent
|
|
||||||
*/
|
|
||||||
explicit CTestVectorMatrix(QObject *parent = 0) : QObject(parent) {}
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/*!
|
//! Vector tests
|
||||||
* \brief Basic unit tests for physical units
|
|
||||||
*/
|
|
||||||
void vectorBasics();
|
void vectorBasics();
|
||||||
|
|
||||||
/*!
|
//! Matrix tests
|
||||||
* \brief Vertical positions
|
|
||||||
*/
|
|
||||||
void matrixBasics();
|
void matrixBasics();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user