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
891d9177
Commit
891d9177
authored
Apr 23, 2017
by
Don Gagne
Committed by
GitHub
Apr 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5049 from DonLakeFlyer/UnitTestFixes
UT fixes and code fixes for found bugs
parents
c4510269
48c02d39
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
8 deletions
+12
-8
MissionControllerManagerTest.cc
src/MissionManager/MissionControllerManagerTest.cc
+4
-3
MissionControllerManagerTest.h
src/MissionManager/MissionControllerManagerTest.h
+2
-0
MissionManager.cc
src/MissionManager/MissionManager.cc
+2
-1
MissionManagerTest.cc
src/MissionManager/MissionManagerTest.cc
+4
-4
No files found.
src/MissionManager/MissionControllerManagerTest.cc
View file @
891d9177
...
...
@@ -36,6 +36,7 @@ void MissionControllerManagerTest::_initForFirmwareType(MAV_AUTOPILOT firmwareTy
QVERIFY
(
_missionManager
);
_rgMissionManagerSignals
[
newMissionItemsAvailableSignalIndex
]
=
SIGNAL
(
newMissionItemsAvailable
(
bool
));
_rgMissionManagerSignals
[
sendCompleteSignalIndex
]
=
SIGNAL
(
sendComplete
(
void
));
_rgMissionManagerSignals
[
inProgressChangedSignalIndex
]
=
SIGNAL
(
inProgressChanged
(
bool
));
_rgMissionManagerSignals
[
errorSignalIndex
]
=
SIGNAL
(
error
(
int
,
const
QString
&
));
...
...
src/MissionManager/MissionControllerManagerTest.h
View file @
891d9177
...
...
@@ -55,6 +55,7 @@ protected:
typedef
enum
{
newMissionItemsAvailableSignalIndex
=
0
,
sendCompleteSignalIndex
,
inProgressChangedSignalIndex
,
errorSignalIndex
,
maxSignalIndex
...
...
@@ -62,6 +63,7 @@ protected:
typedef
enum
{
newMissionItemsAvailableSignalMask
=
1
<<
newMissionItemsAvailableSignalIndex
,
sendCompleteSignalMask
=
1
<<
sendCompleteSignalIndex
,
inProgressChangedSignalMask
=
1
<<
inProgressChangedSignalIndex
,
errorSignalMask
=
1
<<
errorSignalIndex
,
}
MissionManagerSignalMask_t
;
...
...
src/MissionManager/MissionManager.cc
View file @
891d9177
...
...
@@ -868,8 +868,9 @@ void MissionManager::_finishTransaction(bool success)
// First thing we do is clear the transaction. This way inProgesss is off when we signal transaction complete.
TransactionType_t
currentTransactionType
=
_transactionInProgress
;
_transactionInProgress
=
TransactionNone
;
if
(
_transactionInProgress
!=
TransactionNone
)
{
if
(
currentTransactionType
!=
TransactionNone
)
{
_transactionInProgress
=
TransactionNone
;
qDebug
()
<<
"inProgressChanged"
;
emit
inProgressChanged
(
false
);
}
...
...
src/MissionManager/MissionManagerTest.cc
View file @
891d9177
...
...
@@ -60,9 +60,8 @@ void MissionManagerTest::_writeItems(MockLinkMissionItemHandler::FailureMode_t f
// writeMissionItems should emit these signals before returning:
// inProgressChanged
// newMissionItemsAvailable
QVERIFY
(
_missionManager
->
inProgress
());
QCOMPARE
(
_multiSpyMissionManager
->
checkSignalByMask
(
inProgressChangedSignalMask
|
newMissionItemsAvailableSignalMask
),
true
);
QCOMPARE
(
_multiSpyMissionManager
->
checkSignalByMask
(
inProgressChangedSignalMask
),
true
);
_checkInProgressValues
(
true
);
_multiSpyMissionManager
->
clearAllSignals
();
...
...
@@ -93,8 +92,9 @@ void MissionManagerTest::_writeItems(MockLinkMissionItemHandler::FailureMode_t f
// Wait for write sequence to complete. We should get:
// inProgressChanged(false) signal
_multiSpyMissionManager
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
_missionManagerSignalWaitTime
);
QCOMPARE
(
_multiSpyMissionManager
->
checkOnlySignalByMask
(
inProgressChangedSignalMask
),
true
);
// sednComplete signal
_multiSpyMissionManager
->
waitForSignalByIndex
(
sendCompleteSignalIndex
,
_missionManagerSignalWaitTime
);
QCOMPARE
(
_multiSpyMissionManager
->
checkSignalByMask
(
inProgressChangedSignalMask
|
sendCompleteSignalMask
),
true
);
// Validate inProgressChanged signal value
_checkInProgressValues
(
false
);
...
...
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