Commit 7a15f9e1 authored by dogmaphobic's avatar dogmaphobic

Missed a few places where Mock Link had references on Release builds.

parent cb41567d
......@@ -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 \
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
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 <http://www.gnu.org/licenses/>.
======================================================================*/
/// @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<QObject*>("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<QObject*>("testControl");
QVERIFY(control != NULL);
QCOMPARE(control->property("text").toInt(), 12);
delete widget;
}
......@@ -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
......
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