Browse Source

Suppress selected vertex out of bounds warning in unit tests

QGC4.4
Aleksey Kontsevich 5 years ago
parent
commit
c43a496789
  1. 7
      src/MissionManager/QGCMapPolygon.cc
  2. 6
      src/MissionManager/QGCMapPolyline.cc

7
src/MissionManager/QGCMapPolygon.cc

@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
#include "QGCQGeoCoordinate.h"
#include "QGCApplication.h"
#include "ShapeFileHelper.h"
#include "QGCLoggingCategory.h"
#include <QGeoRectangle>
#include <QDebug>
@ -635,7 +636,11 @@ void QGCMapPolygon::selectVertex(int index) @@ -635,7 +636,11 @@ void QGCMapPolygon::selectVertex(int index)
if(-1 <= index && index < count()) {
_selectedVertexIndex = index;
} else {
qWarning() << "QGCMapPolygon: Selected vertex index is out of bounds!";
if (!qgcApp()->runningUnitTests()) {
qCWarning(ParameterManagerLog)
<< QString("QGCMapPolygon: Selected vertex index (%1) is out of bounds! "
"Polygon vertices indexes range is [%2..%3].").arg(index).arg(0).arg(count()-1);
}
_selectedVertexIndex = -1; // deselect vertex
}

6
src/MissionManager/QGCMapPolyline.cc

@ -452,7 +452,11 @@ void QGCMapPolyline::selectVertex(int index) @@ -452,7 +452,11 @@ void QGCMapPolyline::selectVertex(int index)
if(-1 <= index && index < count()) {
_selectedVertexIndex = index;
} else {
qWarning() << "QGCMapPolyline: Selected vertex index is out of bounds!";
if (!qgcApp()->runningUnitTests()) {
qCWarning(ParameterManagerLog)
<< QString("QGCMapPolyline: Selected vertex index (%1) is out of bounds! "
"Polyline vertices indexes range is [%2..%3].").arg(index).arg(0).arg(count()-1);
}
_selectedVertexIndex = -1; // deselect vertex
}

Loading…
Cancel
Save