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
4ace2fe9
Commit
4ace2fe9
authored
Oct 08, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update signal wait times
parent
3f1cdca0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
MissionManager.h
src/MissionManager/MissionManager.h
+4
-3
MissionManagerTest.cc
src/MissionManager/MissionManagerTest.cc
+8
-8
MissionManagerTest.h
src/MissionManager/MissionManagerTest.h
+1
-0
No files found.
src/MissionManager/MissionManager.h
View file @
4ace2fe9
...
...
@@ -79,6 +79,10 @@ public:
MissingRequestsError
,
///< Vehicle did not request all items during write sequence
}
ErrorCode_t
;
// These values are public so the unit test can set appropriate signal wait times
static
const
int
_ackTimeoutMilliseconds
=
2000
;
static
const
int
_maxRetryCount
=
5
;
signals:
// Public signals
void
canEditChanged
(
bool
canEdit
);
...
...
@@ -127,9 +131,6 @@ private:
QMutex
_dataMutex
;
QmlObjectListModel
_missionItems
;
static
const
int
_ackTimeoutMilliseconds
=
2000
;
static
const
int
_maxRetryCount
=
5
;
};
#endif
\ No newline at end of file
src/MissionManager/MissionManagerTest.cc
View file @
4ace2fe9
...
...
@@ -77,8 +77,8 @@ void MissionManagerTest::init(void)
QCOMPARE
(
_multiSpy
->
init
(
_missionManager
,
_rgSignals
,
_cSignals
),
true
);
if
(
_missionManager
->
inProgress
())
{
_multiSpy
->
waitForSignalByIndex
(
newMissionItemsAvailableSignalIndex
,
1000
);
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
1000
);
_multiSpy
->
waitForSignalByIndex
(
newMissionItemsAvailableSignalIndex
,
_signalWaitTime
);
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
_signalWaitTime
);
QCOMPARE
(
_multiSpy
->
checkSignalByMask
(
newMissionItemsAvailableSignalMask
|
inProgressChangedSignalMask
),
true
);
QCOMPARE
(
_multiSpy
->
checkNoSignalByMask
(
canEditChangedSignalIndex
),
true
);
}
...
...
@@ -123,8 +123,8 @@ void MissionManagerTest::_readEmptyVehicle(void)
// Now wait for read sequence to complete. We should get both a newMissionItemsAvailable and a
// inProgressChanged signal to signal completion.
_multiSpy
->
waitForSignalByIndex
(
newMissionItemsAvailableSignalIndex
,
1000
);
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
1000
);
_multiSpy
->
waitForSignalByIndex
(
newMissionItemsAvailableSignalIndex
,
_signalWaitTime
);
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
_signalWaitTime
);
QCOMPARE
(
_multiSpy
->
checkSignalByMask
(
newMissionItemsAvailableSignalMask
|
inProgressChangedSignalMask
),
true
);
QCOMPARE
(
_multiSpy
->
checkNoSignalByMask
(
canEditChangedSignalMask
),
true
);
_checkInProgressValues
(
false
);
...
...
@@ -172,7 +172,7 @@ void MissionManagerTest::_writeItems(MockLinkMissionItemHandler::FailureMode_t f
// Wait for write sequence to complete. We should get:
// inProgressChanged(false) signal
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
10000
);
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
_signalWaitTime
);
QCOMPARE
(
_multiSpy
->
checkOnlySignalByMask
(
inProgressChangedSignalMask
),
true
);
// Validate inProgressChanged signal value
...
...
@@ -186,7 +186,7 @@ void MissionManagerTest::_writeItems(MockLinkMissionItemHandler::FailureMode_t f
// Wait for write sequence to complete. We should get:
// inProgressChanged(false) signal
// error(errorCode, QString) signal
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
10000
);
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
_signalWaitTime
);
QCOMPARE
(
_multiSpy
->
checkSignalByMask
(
inProgressChangedSignalMask
|
errorSignalMask
),
true
);
// Validate inProgressChanged signal value
...
...
@@ -258,7 +258,7 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode
// Now wait for read sequence to complete. We should get:
// inProgressChanged(false) signal to signal completion
// newMissionItemsAvailable signal
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
10000
);
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
_signalWaitTime
);
QCOMPARE
(
_multiSpy
->
checkSignalByMask
(
newMissionItemsAvailableSignalMask
|
inProgressChangedSignalMask
),
true
);
QCOMPARE
(
_multiSpy
->
checkNoSignalByMask
(
canEditChangedSignalMask
),
true
);
_checkInProgressValues
(
false
);
...
...
@@ -269,7 +269,7 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode
// inProgressChanged(false) signal to signal completion
// error(errorCode, QString) signal
// newMissionItemsAvailable signal
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
10000
);
_multiSpy
->
waitForSignalByIndex
(
inProgressChangedSignalIndex
,
_signalWaitTime
);
QCOMPARE
(
_multiSpy
->
checkSignalByMask
(
newMissionItemsAvailableSignalMask
|
inProgressChangedSignalMask
|
errorSignalMask
),
true
);
// Validate inProgressChanged signal value
...
...
src/MissionManager/MissionManagerTest.h
View file @
4ace2fe9
...
...
@@ -91,6 +91,7 @@ private:
}
TestCase_t
;
static
const
TestCase_t
_rgTestCases
[];
static
const
int
_signalWaitTime
=
MissionManager
::
_ackTimeoutMilliseconds
*
MissionManager
::
_maxRetryCount
*
2
;
};
#endif
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