Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
65da5b36
Commit
65da5b36
authored
Oct 23, 2018
by
Patrick José Pereira
Browse files
qgcunittest: Change from foreach to c++11 for
Signed-off-by:
Patrick José Pereira
<
patrickelectric@gmail.com
>
parent
29db9519
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/qgcunittest/MavlinkLogTest.cc
View file @
65da5b36
...
...
@@ -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
));
for
each
(
const
QString
&
logFile
,
logFiles
)
{
for
(
const
QString
&
logFile
:
logFiles
)
{
bool
success
=
tmpDir
.
remove
(
logFile
);
Q_UNUSED
(
success
);
Q_ASSERT
(
success
);
...
...
src/qgcunittest/RadioConfigTest.cc
View file @
65da5b36
...
...
@@ -207,7 +207,7 @@ void RadioConfigTest::_init(MAV_AUTOPILOT firmwareType)
// Find the radio component
QObject
*
vehicleComponent
=
NULL
;
for
each
(
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"
;
for
each
(
const
QString
&
switchParam
,
switchList
)
{
for
(
const
QString
&
switchParam
:
switchList
)
{
Q_ASSERT
(
_vehicle
->
parameterManager
()
->
getParameter
(
FactSystem
::
defaultComponentId
,
switchParam
)
->
rawValue
().
toInt
()
!=
channel
+
1
);
}
}
...
...
src/qgcunittest/UnitTest.cc
View file @
65da5b36
...
...
@@ -81,7 +81,7 @@ int UnitTest::run(QString& singleTest)
{
int
ret
=
0
;
for
each
(
QObject
*
test
,
_testList
())
{
for
(
QObject
*
test
:
_testList
())
{
if
(
singleTest
.
isEmpty
()
||
singleTest
==
test
->
objectName
())
{
QStringList
args
;
args
<<
"*"
<<
"-maxwarnings"
<<
"0"
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment