From c43a4967890f671e95e56ee19bbdffadf036e4ad Mon Sep 17 00:00:00 2001 From: Aleksey Kontsevich Date: Tue, 9 Jun 2020 23:44:45 +0300 Subject: [PATCH] Suppress selected vertex out of bounds warning in unit tests --- src/MissionManager/QGCMapPolygon.cc | 7 ++++++- src/MissionManager/QGCMapPolyline.cc | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/MissionManager/QGCMapPolygon.cc b/src/MissionManager/QGCMapPolygon.cc index 804ab6963..7c6afd451 100644 --- a/src/MissionManager/QGCMapPolygon.cc +++ b/src/MissionManager/QGCMapPolygon.cc @@ -13,6 +13,7 @@ #include "QGCQGeoCoordinate.h" #include "QGCApplication.h" #include "ShapeFileHelper.h" +#include "QGCLoggingCategory.h" #include #include @@ -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 } diff --git a/src/MissionManager/QGCMapPolyline.cc b/src/MissionManager/QGCMapPolyline.cc index aec2a01c1..3efdecc9e 100644 --- a/src/MissionManager/QGCMapPolyline.cc +++ b/src/MissionManager/QGCMapPolyline.cc @@ -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 } -- 2.22.0