From 7a15f9e1902fbbfec518f94e0b2dec2ec10e2be9 Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Thu, 3 Dec 2015 13:01:00 -0500 Subject: [PATCH] Missed a few places where Mock Link had references on Release builds. --- qgroundcontrol.pro | 30 +++++++++++----- src/FactSystem/FactSystemTestBase.cc | 54 ++++++++++++++-------------- src/ui/QGCCommConfiguration.cc | 2 ++ 3 files changed, 51 insertions(+), 35 deletions(-) diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 6339ed99b..4cc5c824e 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -188,7 +188,6 @@ FORMS += \ src/QGCQmlWidgetHolder.ui \ src/ui/MainWindow.ui \ src/ui/MAVLinkSettingsWidget.ui \ - src/ui/MockLinkConfiguration.ui \ src/ui/QGCCommConfiguration.ui \ src/ui/QGCLinkConfiguration.ui \ src/ui/QGCMapRCToParamDialog.ui \ @@ -199,6 +198,11 @@ FORMS += \ src/ui/uas/QGCUnconnectedInfoWidget.ui \ src/ui/uas/UASMessageView.ui \ +DebugBuild { +FORMS += \ + src/ui/MockLinkConfiguration.ui \ +} + !iOSBuild { FORMS += \ src/ui/SerialSettings.ui \ @@ -231,9 +235,6 @@ HEADERS += \ src/comm/LinkInterface.h \ src/comm/LinkManager.h \ src/comm/MAVLinkProtocol.h \ - src/comm/MockLink.h \ - src/comm/MockLinkFileServer.h \ - src/comm/MockLinkMissionItemHandler.h \ src/comm/ProtocolInterface.h \ src/comm/QGCMAVLink.h \ src/comm/TCPLink.h \ @@ -278,7 +279,6 @@ HEADERS += \ src/ui/MainWindow.h \ src/ui/MAVLinkDecoder.h \ src/ui/MAVLinkSettingsWidget.h \ - src/ui/MockLinkConfiguration.h \ src/ui/QGCCommConfiguration.h \ src/ui/QGCLinkConfiguration.h \ src/ui/QGCMapRCToParamDialog.h \ @@ -292,6 +292,14 @@ HEADERS += \ src/AutoPilotPlugins/PX4/PX4AirframeLoader.h \ src/QmlControls/QGCImageProvider.h \ +DebugBuild { +HEADERS += \ + src/comm/MockLink.h \ + src/comm/MockLinkFileServer.h \ + src/comm/MockLinkMissionItemHandler.h \ + src/ui/MockLinkConfiguration.h \ +} + WindowsBuild { PRECOMPILED_HEADER += src/stable_headers.h HEADERS += src/stable_headers.h @@ -349,9 +357,6 @@ SOURCES += \ src/comm/LinkConfiguration.cc \ src/comm/LinkManager.cc \ src/comm/MAVLinkProtocol.cc \ - src/comm/MockLink.cc \ - src/comm/MockLinkFileServer.cc \ - src/comm/MockLinkMissionItemHandler.cc \ src/comm/TCPLink.cc \ src/comm/UDPLink.cc \ src/FlightDisplay/FlightDisplayViewController.cc \ @@ -390,7 +395,6 @@ SOURCES += \ src/ui/MainWindow.cc \ src/ui/MAVLinkDecoder.cc \ src/ui/MAVLinkSettingsWidget.cc \ - src/ui/MockLinkConfiguration.cc \ src/ui/QGCCommConfiguration.cc \ src/ui/QGCLinkConfiguration.cc \ src/ui/QGCMapRCToParamDialog.cpp \ @@ -404,6 +408,14 @@ SOURCES += \ src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc \ src/QmlControls/QGCImageProvider.cc \ +DebugBuild { +SOURCES += \ + src/comm/MockLink.cc \ + src/comm/MockLinkFileServer.cc \ + src/comm/MockLinkMissionItemHandler.cc \ + src/ui/MockLinkConfiguration.cc \ +} + !iOSBuild { SOURCES += \ src/comm/QGCSerialPortInfo.cc \ diff --git a/src/FactSystem/FactSystemTestBase.cc b/src/FactSystem/FactSystemTestBase.cc index 885628b96..ca5063f17 100644 --- a/src/FactSystem/FactSystemTestBase.cc +++ b/src/FactSystem/FactSystemTestBase.cc @@ -1,24 +1,24 @@ /*===================================================================== - + QGroundControl Open Source Ground Control Station - + (c) 2009 - 2014 QGROUNDCONTROL PROJECT - + This file is part of the QGROUNDCONTROL project - + QGROUNDCONTROL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + QGROUNDCONTROL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with QGROUNDCONTROL. If not, see . - + ======================================================================*/ /// @file @@ -26,7 +26,9 @@ #include "FactSystemTestBase.h" #include "LinkManager.h" +#ifdef QT_DEBUG #include "MockLink.h" +#endif #include "MultiVehicleManager.h" #include "QGCApplication.h" #include "QGCMessageBox.h" @@ -37,15 +39,15 @@ /// FactSystem Unit Test FactSystemTestBase::FactSystemTestBase(void) { - + } void FactSystemTestBase::_init(MAV_AUTOPILOT autopilot) { UnitTest::init(); - + _connectMockLink(autopilot); - + _plugin = qgcApp()->toolbox()->multiVehicleManager()->activeVehicle()->autopilotPlugin(); Q_ASSERT(_plugin); } @@ -63,7 +65,7 @@ void FactSystemTestBase::_parameter_default_component_id_test(void) QVERIFY(fact != NULL); QVariant factValue = fact->rawValue(); QCOMPARE(factValue.isValid(), true); - + QCOMPARE(factValue.toInt(), 3); } @@ -74,17 +76,17 @@ void FactSystemTestBase::_parameter_specific_component_id_test(void) QVERIFY(fact != NULL); QVariant factValue = fact->rawValue(); QCOMPARE(factValue.isValid(), true); - - + + QCOMPARE(factValue.toInt(), 3); - + // Test another component id QVERIFY(_plugin->factExists(FactSystem::ParameterProvider, 51, "COMPONENT_51")); fact = _plugin->getFact(FactSystem::ParameterProvider, 51, "COMPONENT_51"); QVERIFY(fact != NULL); factValue = fact->rawValue(); QCOMPARE(factValue.isValid(), true); - + QCOMPARE(factValue.toInt(), 51); } @@ -92,18 +94,18 @@ void FactSystemTestBase::_parameter_specific_component_id_test(void) void FactSystemTestBase::_qml_test(void) { QGCQuickWidget* widget = new QGCQuickWidget; - + widget->setAutoPilot(_plugin); - + widget->setSource(QUrl::fromUserInput("qrc:unittest/FactSystemTest.qml")); - + QQuickItem* rootObject = widget->rootObject(); QObject* control = rootObject->findChild("testControl"); QVERIFY(control != NULL); QVariant qmlValue = control->property("text").toInt(); QCOMPARE(qmlValue.toInt(), 3); - + delete widget; } @@ -111,25 +113,25 @@ void FactSystemTestBase::_qml_test(void) void FactSystemTestBase::_qmlUpdate_test(void) { QGCQuickWidget* widget = new QGCQuickWidget; - + widget->setAutoPilot(_plugin); - + widget->setSource(QUrl::fromUserInput("qrc:unittest/FactSystemTest.qml")); - + // Change the value - + QVariant paramValue = 12; _plugin->getParameterFact(FactSystem::defaultComponentId, "RC_MAP_THROTTLE")->setRawValue(paramValue); QTest::qWait(500); // Let the signals flow through - + // Make sure the qml has the right value - + QQuickItem* rootObject = widget->rootObject(); QObject* control = rootObject->findChild("testControl"); QVERIFY(control != NULL); QCOMPARE(control->property("text").toInt(), 12); - + delete widget; } diff --git a/src/ui/QGCCommConfiguration.cc b/src/ui/QGCCommConfiguration.cc index 621bef9e6..85f759430 100644 --- a/src/ui/QGCCommConfiguration.cc +++ b/src/ui/QGCCommConfiguration.cc @@ -36,7 +36,9 @@ This file is part of the QGROUNDCONTROL project #endif #include "QGCUDPLinkConfiguration.h" #include "QGCTCPLinkConfiguration.h" +#ifdef QT_DEBUG #include "MockLinkConfiguration.h" +#endif #ifndef __mobile__ #include "LogReplayLinkConfigurationWidget.h" #endif -- 2.22.0