Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
674a5b7f
Commit
674a5b7f
authored
Aug 29, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update unit tests to new MultiVehicleManager signaling
parent
4d28975d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
27 deletions
+14
-27
FactSystemTestBase.cc
src/FactSystem/FactSystemTestBase.cc
+4
-11
SetupViewTest.cc
src/VehicleSetup/SetupViewTest.cc
+4
-9
PX4RCCalibrationTest.cc
src/qgcunittest/PX4RCCalibrationTest.cc
+6
-7
No files found.
src/FactSystem/FactSystemTestBase.cc
View file @
674a5b7f
...
...
@@ -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
)
...
...
src/VehicleSetup/SetupViewTest.cc
View file @
674a5b7f
...
...
@@ -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
);
...
...
src/qgcunittest/PX4RCCalibrationTest.cc
View file @
674a5b7f
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment