From 4a35923473d9575416544d1c354497c0e47ad6e1 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Mon, 27 Apr 2015 15:57:45 -0700 Subject: [PATCH] Make sure pluginReady before creating rc cal widget --- src/qgcunittest/PX4RCCalibrationTest.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qgcunittest/PX4RCCalibrationTest.cc b/src/qgcunittest/PX4RCCalibrationTest.cc index 304d216171..966c586b6c 100644 --- a/src/qgcunittest/PX4RCCalibrationTest.cc +++ b/src/qgcunittest/PX4RCCalibrationTest.cc @@ -154,6 +154,12 @@ void PX4RCCalibrationTest::init(void) _autopilot = AutoPilotPluginManager::instance()->getInstanceForAutoPilotPlugin(UASManager::instance()->getActiveUAS()); Q_ASSERT(_autopilot); + QSignalSpy spyPlugin(_autopilot, SIGNAL(pluginReadyChanged(bool))); + if (!_autopilot->pluginReady()) { + QCOMPARE(spyPlugin.wait(10000), true); + } + Q_ASSERT(_autopilot->pluginReady()); + // This will instatiate the widget with an active uas with ready parameters _calWidget = new PX4RCCalibration(); Q_CHECK_PTR(_calWidget); -- GitLab