Commit 65da5b36 authored by Patrick José Pereira's avatar Patrick José Pereira

qgcunittest: Change from foreach to c++11 for

Signed-off-by: 's avatarPatrick José Pereira <patrickelectric@gmail.com>
parent 29db9519
......@@ -38,7 +38,7 @@ void MavlinkLogTest::init(void)
// Make sure temp directory is clear of mavlink logs
QDir tmpDir(QStandardPaths::writableLocation(QStandardPaths::TempLocation));
QStringList logFiles(tmpDir.entryList(QStringList(QString("*.%1").arg(_logFileExtension)), QDir::Files));
foreach(const QString &logFile, logFiles) {
for(const QString &logFile: logFiles) {
bool success = tmpDir.remove(logFile);
Q_UNUSED(success);
Q_ASSERT(success);
......
......@@ -207,7 +207,7 @@ void RadioConfigTest::_init(MAV_AUTOPILOT firmwareType)
// Find the radio component
QObject* vehicleComponent = NULL;
foreach (const QVariant& varVehicleComponent, _autopilot->vehicleComponents()) {
for (const QVariant& varVehicleComponent: _autopilot->vehicleComponents()) {
if (firmwareType == MAV_AUTOPILOT_PX4) {
PX4RadioComponent* radioComponent = qobject_cast<PX4RadioComponent*>(varVehicleComponent.value<VehicleComponent*>());
if (radioComponent) {
......@@ -370,7 +370,7 @@ void RadioConfigTest::_fullCalibrationWorker(MAV_AUTOPILOT firmwareType)
QStringList switchList;
switchList << "RC_MAP_MODE_SW" << "RC_MAP_LOITER_SW" << "RC_MAP_RETURN_SW" << "RC_MAP_POSCTL_SW" << "RC_MAP_ACRO_SW";
foreach (const QString &switchParam, switchList) {
for (const QString &switchParam: switchList) {
Q_ASSERT(_vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, switchParam)->rawValue().toInt() != channel + 1);
}
}
......
......@@ -81,7 +81,7 @@ int UnitTest::run(QString& singleTest)
{
int ret = 0;
foreach (QObject* test, _testList()) {
for (QObject* test: _testList()) {
if (singleTest.isEmpty() || singleTest == test->objectName()) {
QStringList args;
args << "*" << "-maxwarnings" << "0";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment