diff --git a/src/FactSystem/FactSystemTestBase.cc b/src/FactSystem/FactSystemTestBase.cc index a6e2d626236d82dad5fbcd463ab0987f20175f45..01168f0a9594554d57c44b6a39c8d2b8535b2ebf 100644 --- a/src/FactSystem/FactSystemTestBase.cc +++ b/src/FactSystem/FactSystemTestBase.cc @@ -51,20 +51,13 @@ void FactSystemTestBase::_init(MAV_AUTOPILOT autopilot) LinkManager::instance()->connectLink(link); // Wait for the Vehicle to get created - QSignalSpy spyUas(MultiVehicleManager::instance(), SIGNAL(activeVehicleAvailableChanged(bool))); - QCOMPARE(spyUas.wait(5000), true); - QVERIFY(MultiVehicleManager::instance()->activeVehicleAvailable()); + QSignalSpy spyVehicle(MultiVehicleManager::instance(), SIGNAL(parameterReadyVehicleAvailableChanged(bool))); + QCOMPARE(spyVehicle.wait(5000), true); + QVERIFY(MultiVehicleManager::instance()->parameterReadyVehicleAvailable()); + QVERIFY(MultiVehicleManager::instance()->activeVehicle()); _plugin = MultiVehicleManager::instance()->activeVehicle()->autopilotPlugin(); Q_ASSERT(_plugin); - - // Wait for the plugin to be ready - - QSignalSpy spyPlugin(_plugin, SIGNAL(pluginReadyChanged(bool))); - if (!_plugin->pluginReady()) { - QCOMPARE(spyPlugin.wait(60000), true); - } - Q_ASSERT(_plugin->pluginReady()); } void FactSystemTestBase::_cleanup(void) diff --git a/src/VehicleSetup/SetupViewTest.cc b/src/VehicleSetup/SetupViewTest.cc index 9c264889ed9332daef5a9c6cb06137cfb2d0a39e..c7f05e60f4557e043329d364df299b5ad30c1e55 100644 --- a/src/VehicleSetup/SetupViewTest.cc +++ b/src/VehicleSetup/SetupViewTest.cc @@ -71,19 +71,14 @@ void SetupViewTest::_clickThrough_test(void) linkMgr->connectLink(link); // Wait for the Vehicle to get created - QSignalSpy spyUas(MultiVehicleManager::instance(), SIGNAL(activeVehicleAvailableChanged(bool))); - QCOMPARE(spyUas.wait(5000), true); - QVERIFY(MultiVehicleManager::instance()->activeVehicleAvailable()); + QSignalSpy spyVehicle(MultiVehicleManager::instance(), SIGNAL(parameterReadyVehicleAvailableChanged(bool))); + QCOMPARE(spyVehicle.wait(5000), true); + QVERIFY(MultiVehicleManager::instance()->parameterReadyVehicleAvailable()); + QVERIFY(MultiVehicleManager::instance()->activeVehicle()); AutoPilotPlugin* autopilot = MultiVehicleManager::instance()->activeVehicle()->autopilotPlugin(); Q_ASSERT(autopilot); - QSignalSpy spyPlugin(autopilot, SIGNAL(pluginReadyChanged(bool))); - if (!autopilot->pluginReady()) { - QCOMPARE(spyPlugin.wait(60000), true); - } - Q_ASSERT(autopilot->pluginReady()); - // Switch to the Setup view _mainToolBar->onSetupView(); QTest::qWait(1000); diff --git a/src/qgcunittest/PX4RCCalibrationTest.cc b/src/qgcunittest/PX4RCCalibrationTest.cc index 9357a95949a59f5aeff8038707ac70b9eef0b109..e5f5160297d31ddff6051084e3affab6cf55a274 100644 --- a/src/qgcunittest/PX4RCCalibrationTest.cc +++ b/src/qgcunittest/PX4RCCalibrationTest.cc @@ -153,17 +153,16 @@ void RadioConfigTest::init(void) Q_CHECK_PTR(_mockLink); LinkManager::instance()->_addLink(_mockLink); LinkManager::instance()->connectLink(_mockLink); - QTest::qWait(5000); // Give enough time for UI to settle and heartbeats to go through + + // Wait for the Vehicle to get created + QSignalSpy spyVehicle(MultiVehicleManager::instance(), SIGNAL(parameterReadyVehicleAvailableChanged(bool))); + QCOMPARE(spyVehicle.wait(5000), true); + QVERIFY(MultiVehicleManager::instance()->parameterReadyVehicleAvailable()); + QVERIFY(MultiVehicleManager::instance()->activeVehicle()); _autopilot = MultiVehicleManager::instance()->activeVehicle()->autopilotPlugin(); Q_ASSERT(_autopilot); - QSignalSpy spyPlugin(_autopilot, SIGNAL(pluginReadyChanged(bool))); - if (!_autopilot->pluginReady()) { - QCOMPARE(spyPlugin.wait(60000), true); - } - Q_ASSERT(_autopilot->pluginReady()); - // This will instatiate the widget with an active uas with ready parameters _calWidget = new QGCQmlWidgetHolder(); _calWidget->resize(600, 600);