Commit c43a4967 authored by Aleksey Kontsevich's avatar Aleksey Kontsevich

Suppress selected vertex out of bounds warning in unit tests

parent aca27c21
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "QGCQGeoCoordinate.h" #include "QGCQGeoCoordinate.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#include "ShapeFileHelper.h" #include "ShapeFileHelper.h"
#include "QGCLoggingCategory.h"
#include <QGeoRectangle> #include <QGeoRectangle>
#include <QDebug> #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()) { if(-1 <= index && index < count()) {
_selectedVertexIndex = index; _selectedVertexIndex = index;
} else { } 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 _selectedVertexIndex = -1; // deselect vertex
} }
......
...@@ -452,7 +452,11 @@ void QGCMapPolyline::selectVertex(int index) ...@@ -452,7 +452,11 @@ void QGCMapPolyline::selectVertex(int index)
if(-1 <= index && index < count()) { if(-1 <= index && index < count()) {
_selectedVertexIndex = index; _selectedVertexIndex = index;
} else { } 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 _selectedVertexIndex = -1; // deselect vertex
} }
......
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