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
5b11ef19
Commit
5b11ef19
authored
Oct 09, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for ui error display
parent
2d710f9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
45 deletions
+9
-45
MissionManagerTest.cc
src/MissionManager/MissionManagerTest.cc
+7
-43
MissionManagerTest.h
src/MissionManager/MissionManagerTest.h
+2
-2
No files found.
src/MissionManager/MissionManagerTest.cc
View file @
5b11ef19
...
...
@@ -183,6 +183,8 @@ void MissionManagerTest::_writeItems(MockLinkMissionItemHandler::FailureMode_t f
}
else
{
// This should be a failed run
setExpectedMessageBox
(
QMessageBox
::
Ok
);
// Wait for write sequence to complete. We should get:
// inProgressChanged(false) signal
// error(errorCode, QString) signal
...
...
@@ -199,30 +201,7 @@ void MissionManagerTest::_writeItems(MockLinkMissionItemHandler::FailureMode_t f
qDebug
()
<<
signalArgs
[
1
].
toString
();
QCOMPARE
(
signalArgs
[
0
].
toInt
(),
(
int
)
errorCode
);
/*
// FIXME: This should be on the read side
// Validate correct number of mission items
int expectedMissionCount = 0;
switch (ErrorCode) {
case FailWriteRequest0NoResponse:
// Don't respond to MISSION_COUNT with MISSION_REQUEST 0
expectedMissionCount = 0;
break;
case FailWriteRequest1NoResponse: // Don't respond to MISSION_ITEM 0 with MISSION_REQUEST 1
case FailWriteRequest0IncorrectSequence: // Respond to MISSION_COUNT 0 with MISSION_REQUEST with wrong sequence number
case FailWriteRequest1IncorrectSequence: // Respond to MISSION_ITEM 0 with MISSION_REQUEST with wrong sequence number
case FailWriteRequest0ErrorAck: // Respond to MISSION_COUNT 0 with MISSION_ACK error
case FailWriteRequest1ErrorAck: // Respond to MISSION_ITEM 0 with MISSION_ACK error
case FailWriteFinalAckNoResponse: // Don't send the final MISSION_ACK
case FailWriteFinalAckErrorAck: // Send an error as the final MISSION_ACK
case FailWriteFinalAckMissingRequests: // Send the MISSION_ACK before all items have been requested
break;
}
// FIXME: Count depends on errorCode
//QCOMPARE(_missionManager->missionItems()->count(), (int)cTestCases);
*/
checkExpectedMessageBox
();
}
QCOMPARE
(
_missionManager
->
canEdit
(),
true
);
...
...
@@ -265,6 +244,8 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode
}
else
{
// This should be a failed run
setExpectedMessageBox
(
QMessageBox
::
Ok
);
// Wait for read sequence to complete. We should get:
// inProgressChanged(false) signal to signal completion
// error(errorCode, QString) signal
...
...
@@ -281,6 +262,8 @@ void MissionManagerTest::_roundTripItems(MockLinkMissionItemHandler::FailureMode
QCOMPARE
(
signalArgs
.
count
(),
2
);
qDebug
()
<<
signalArgs
[
1
].
toString
();
QCOMPARE
(
signalArgs
[
0
].
toInt
(),
(
int
)
errorCode
);
checkExpectedMessageBox
();
}
_multiSpy
->
clearAllSignals
();
...
...
@@ -377,25 +360,6 @@ void MissionManagerTest::_testWriteFailureHandling(void)
void
MissionManagerTest
::
_testReadFailureHandling
(
void
)
{
/*
FailReadRequestListNoResponse, // Don't send MISSION_COUNT in response to MISSION_REQUEST_LIST
FailReadRequest0NoResponse, // Don't send MISSION_ITEM in response to MISSION_REQUEST item 0
FailReadRequest1NoResponse, // Don't send MISSION_ITEM in response to MISSION_REQUEST item 1
FailReadRequest0IncorrectSequence, // Respond to MISSION_REQUEST 0 with incorrect sequence number in MISSION_ITEM
FailReadRequest1IncorrectSequence, // Respond to MISSION_REQUEST 1 with incorrect sequence number in MISSION_ITEM
FailReadRequest0ErrorAck, // Respond to MISSION_REQUEST 0 with MISSION_ACK error
FailReadRequest1ErrorAck, // Respond to MISSION_REQUEST 1 bogus MISSION_ACK error
FailWriteRequest0NoResponse, // Don't respond to MISSION_COUNT with MISSION_REQUEST 0
FailWriteRequest1NoResponse, // Don't respond to MISSION_ITEM 0 with MISSION_REQUEST 1
FailWriteRequest0IncorrectSequence, // Respond to MISSION_COUNT 0 with MISSION_REQUEST with wrong sequence number
FailWriteRequest1IncorrectSequence, // Respond to MISSION_ITEM 0 with MISSION_REQUEST with wrong sequence number
FailWriteRequest0ErrorAck, // Respond to MISSION_COUNT 0 with MISSION_ACK error
FailWriteRequest1ErrorAck, // Respond to MISSION_ITEM 0 with MISSION_ACK error
FailWriteFinalAckNoResponse, // Don't send the final MISSION_ACK
FailWriteFinalAckErrorAck, // Send an error as the final MISSION_ACK
FailWriteFinalAckMissingRequests, // Send the MISSION_ACK before all items have been requested
*/
/*
/// Called to send a MISSION_ACK message while the MissionManager is in idle state
void sendUnexpectedMissionAck(MAV_MISSION_RESULT ackType) { _missionItemHandler.sendUnexpectedMissionAck(ackType); }
...
...
src/MissionManager/MissionManagerTest.h
View file @
5b11ef19
...
...
@@ -40,15 +40,15 @@ private slots:
void
init
(
void
);
void
cleanup
(
void
);
void
_testWriteFailureHandling
(
void
);
void
_testReadFailureHandling
(
void
);
private:
void
_checkInProgressValues
(
bool
inProgress
);
void
_roundTripItems
(
MockLinkMissionItemHandler
::
FailureMode_t
failureMode
,
MissionManager
::
ErrorCode_t
errorCode
,
bool
failFirstTimeOnly
);
void
_writeItems
(
MockLinkMissionItemHandler
::
FailureMode_t
failureMode
,
MissionManager
::
ErrorCode_t
errorCode
,
bool
failFirstTimeOnly
);
void
_readEmptyVehicle
(
void
);
void
_testWriteFailureHandling
(
void
);
MockLink
*
_mockLink
;
MissionManager
*
_missionManager
;
...
...
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