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
6d447410
Commit
6d447410
authored
Nov 24, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix UAS unit test
Destroyed signal must have been working incorrectly in the past.
parent
6d7fb36a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
UASUnitTest.cc
src/qgcunittest/UASUnitTest.cc
+1
-2
UAS.cc
src/uas/UAS.cc
+7
-2
No files found.
src/qgcunittest/UASUnitTest.cc
View file @
6d447410
...
...
@@ -301,7 +301,6 @@ void UASUnitTest::signalWayPoint_test()
void
UASUnitTest
::
signalUASLink_test
()
{
QSignalSpy
spy
(
uas
,
SIGNAL
(
modeChanged
(
int
,
QString
,
QString
)));
uas
->
setMode
(
2
,
0
);
QCOMPARE
(
spy
.
count
(),
0
);
// not solve for UAS not receiving message from UAS
...
...
@@ -347,7 +346,7 @@ void UASUnitTest::signalUASLink_test()
delete
link2
;
QCOMPARE
(
LinkManager
::
instance
()
->
getLinks
().
count
(),
1
);
QCOMPARE
(
uas
->
getLinks
()
->
count
(),
2
);
QCOMPARE
(
uas
->
getLinks
()
->
count
(),
1
);
QCOMPARE
(
static_cast
<
LinkInterface
*>
(
LinkManager
::
instance
()
->
getLinks
().
at
(
0
))
->
getId
(),
static_cast
<
LinkInterface
*>
(
uas
->
getLinks
()
->
at
(
0
))
->
getId
());
...
...
src/uas/UAS.cc
View file @
6d447410
...
...
@@ -3375,8 +3375,13 @@ void UAS::addLink(LinkInterface* link)
void
UAS
::
removeLink
(
QObject
*
object
)
{
// Be careful of the fact that by the time this signal makes it through the queue
// the link object has already been destructed.
links
->
removeAt
(
links
->
indexOf
((
LinkInterface
*
)
object
));
// the link object has already been destructed. So no dynamic_cast for example.
LinkInterface
*
link
=
(
LinkInterface
*
)
object
;
int
index
=
links
->
indexOf
(
link
);
Q_ASSERT
(
index
!=
-
1
);
links
->
removeAt
(
index
);
}
/**
...
...
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