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
4fcb0bed
Unverified
Commit
4fcb0bed
authored
Apr 04, 2018
by
Don Gagne
Committed by
GitHub
Apr 04, 2018
Browse files
Merge pull request #6302 from DonLakeFlyer/TerrainUT
Terrain: Fail all queries while running unit tests
parents
55d5d911
53a32bd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Terrain/TerrainQuery.cc
View file @
4fcb0bed
...
...
@@ -10,6 +10,7 @@
#include
"TerrainQuery.h"
#include
"QGCMapEngine.h"
#include
"QGeoMapReplyQGC.h"
#include
"QGCApplication.h"
#include
<QUrl>
#include
<QUrlQuery>
...
...
@@ -36,6 +37,11 @@ TerrainAirMapQuery::TerrainAirMapQuery(QObject* parent)
void
TerrainAirMapQuery
::
requestCoordinateHeights
(
const
QList
<
QGeoCoordinate
>&
coordinates
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
coordinateHeights
(
false
,
QList
<
double
>
());
return
;
}
QString
points
;
foreach
(
const
QGeoCoordinate
&
coord
,
coordinates
)
{
points
+=
QString
::
number
(
coord
.
latitude
(),
'f'
,
10
)
+
","
...
...
@@ -52,6 +58,11 @@ void TerrainAirMapQuery::requestCoordinateHeights(const QList<QGeoCoordinate>& c
void
TerrainAirMapQuery
::
requestPathHeights
(
const
QGeoCoordinate
&
fromCoord
,
const
QGeoCoordinate
&
toCoord
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
pathHeights
(
false
,
qQNaN
(),
qQNaN
(),
QList
<
double
>
());
return
;
}
QString
points
;
points
+=
QString
::
number
(
fromCoord
.
latitude
(),
'f'
,
10
)
+
","
+
QString
::
number
(
fromCoord
.
longitude
(),
'f'
,
10
)
+
","
;
...
...
@@ -67,6 +78,11 @@ void TerrainAirMapQuery::requestPathHeights(const QGeoCoordinate& fromCoord, con
void
TerrainAirMapQuery
::
requestCarpetHeights
(
const
QGeoCoordinate
&
swCoord
,
const
QGeoCoordinate
&
neCoord
,
bool
statsOnly
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
carpetHeights
(
false
,
qQNaN
(),
qQNaN
(),
QList
<
QList
<
double
>>
());
return
;
}
QString
points
;
points
+=
QString
::
number
(
swCoord
.
latitude
(),
'f'
,
10
)
+
","
+
QString
::
number
(
swCoord
.
longitude
(),
'f'
,
10
)
+
","
;
...
...
@@ -240,6 +256,11 @@ TerrainOfflineAirMapQuery::TerrainOfflineAirMapQuery(QObject* parent)
void
TerrainOfflineAirMapQuery
::
requestCoordinateHeights
(
const
QList
<
QGeoCoordinate
>&
coordinates
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
coordinateHeights
(
false
,
QList
<
double
>
());
return
;
}
if
(
coordinates
.
length
()
==
0
)
{
return
;
}
...
...
@@ -249,11 +270,21 @@ void TerrainOfflineAirMapQuery::requestCoordinateHeights(const QList<QGeoCoordin
void
TerrainOfflineAirMapQuery
::
requestPathHeights
(
const
QGeoCoordinate
&
fromCoord
,
const
QGeoCoordinate
&
toCoord
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
pathHeights
(
false
,
qQNaN
(),
qQNaN
(),
QList
<
double
>
());
return
;
}
_terrainTileManager
->
addPathQuery
(
this
,
fromCoord
,
toCoord
);
}
void
TerrainOfflineAirMapQuery
::
requestCarpetHeights
(
const
QGeoCoordinate
&
swCoord
,
const
QGeoCoordinate
&
neCoord
,
bool
statsOnly
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
carpetHeights
(
false
,
qQNaN
(),
qQNaN
(),
QList
<
QList
<
double
>>
());
return
;
}
// TODO
Q_UNUSED
(
swCoord
);
Q_UNUSED
(
neCoord
);
...
...
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