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
1363ee82
Commit
1363ee82
authored
Jun 27, 2017
by
Don Gagne
Committed by
GitHub
Jun 27, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5349 from DonLakeFlyer/CameraSectionTest
CameraSection: Fixup unit test to new NaN usage
parents
4ab73ba5
73909897
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
170 deletions
+10
-170
CameraSectionTest.cc
src/MissionManager/CameraSectionTest.cc
+10
-170
No files found.
src/MissionManager/CameraSectionTest.cc
View file @
1363ee82
...
...
@@ -675,16 +675,14 @@ void CameraSectionTest::_testScanForCameraModeSection(void)
*/
// Mode command but incorrect settings
/*
SimpleMissionItem
invalidSimpleItem
(
_offlineVehicle
,
_validCameraPhotoModeItem
->
missionItem
());
invalidSimpleItem.missionItem().setParam3(
0); // Audio is not supported
invalidSimpleItem
.
missionItem
().
setParam3
(
1
);
// Audio should be NaN
visualItems
.
append
(
&
invalidSimpleItem
);
QCOMPARE
(
_cameraSection
->
scanForSection
(
&
visualItems
,
scanIndex
),
false
);
QCOMPARE
(
visualItems
.
count
(),
1
);
QCOMPARE
(
_cameraSection
->
specifyCameraMode
(),
false
);
QCOMPARE
(
_cameraSection
->
settingsSpecified
(),
false
);
visualItems
.
clear
();
*/
}
void
CameraSectionTest
::
_testScanForPhotoIntervalTimeSection
(
void
)
...
...
@@ -722,40 +720,6 @@ void CameraSectionTest::_testScanForPhotoIntervalTimeSection(void)
QCOMPARE
(
_cameraSection
->
scanForSection
(
&
visualItems
,
scanIndex
),
false
);
QCOMPARE
(
visualItems
.
count
(),
1
);
visualItems
.
clear
();
/*
invalidSimpleItem.missionItem() = _validTimeItem->missionItem();
invalidSimpleItem.missionItem().setParam4(10); // must be -1 for highest res
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validTimeItem->missionItem();
invalidSimpleItem.missionItem().setParam5(10); // must be -1 for highest res
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validTimeItem->missionItem();
invalidSimpleItem.missionItem().setParam6(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validTimeItem->missionItem();
invalidSimpleItem.missionItem().setParam7(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
*/
}
void
CameraSectionTest
::
_testScanForPhotoIntervalDistanceSection
(
void
)
...
...
@@ -860,8 +824,9 @@ void CameraSectionTest::_testScanForStartVideoSection(void)
/*
MAV_CMD_VIDEO_START_CAPTURE WIP: Starts video capture (recording)
Mission Param #1 Camera ID (0 for all cameras, 1 for first, 2 for second, etc.)
Mission Param #2 Frequency CAMERA_CAPTURE_STATUS messages should be sent while recording (0 for no messages, otherwise time in Hz)
*/
Mission Param #2 Frequency CAMERA_CAPTURE_STATUS messages should be sent while recording (0 for no messages, otherwise frequency in Hz)
Mission Param #3 Reserved
*/
SimpleMissionItem
*
newValidStartVideoItem
=
new
SimpleMissionItem
(
_offlineVehicle
,
this
);
newValidStartVideoItem
->
missionItem
()
=
_validStartVideoItem
->
missionItem
();
...
...
@@ -890,48 +855,6 @@ void CameraSectionTest::_testScanForStartVideoSection(void)
QCOMPARE
(
visualItems
.
count
(),
1
);
QCOMPARE
(
_cameraSection
->
settingsSpecified
(),
false
);
visualItems
.
clear
();
/*
invalidSimpleItem.missionItem() = _validStartVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam3(1); // must be -1
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validStartVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam4(100); // must be -1
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validStartVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam5(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validStartVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam6(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validStartVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam7(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
*/
}
void
CameraSectionTest
::
_testScanForStopVideoSection
(
void
)
...
...
@@ -967,56 +890,6 @@ void CameraSectionTest::_testScanForStopVideoSection(void)
QCOMPARE
(
visualItems
.
count
(),
1
);
QCOMPARE
(
_cameraSection
->
settingsSpecified
(),
false
);
visualItems
.
clear
();
/*
invalidSimpleItem.missionItem() = _validStopVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam2(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validStopVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam3(1); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validStopVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam4(100); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validStopVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam5(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validStopVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam6(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validStopVideoItem->missionItem();
invalidSimpleItem.missionItem().setParam7(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
*/
}
void
CameraSectionTest
::
_testScanForStopImageSection
(
void
)
...
...
@@ -1064,11 +937,12 @@ void CameraSectionTest::_testScanForTakePhotoSection(void)
_commonScanTest
(
_cameraSection
);
/*
MAV_CMD_IMAGE_START_CAPTURE Start image capture sequence. Sends CAMERA_IMAGE_CAPTURED after each capture.
MAV_CMD_IMAGE_START_CAPTURE
WIP:
Start image capture sequence. Sends CAMERA_IMAGE_CAPTURED after each capture.
Mission Param #1 Camera ID (0 for all cameras, 1 for first, 2 for second, etc.)
Mission Param #2 Duration between two consecutive pictures (in seconds)
Mission Param #3 Number of images to capture total - 0 for unlimited capture
*/
Mission Param #4 Reserved
*/
SimpleMissionItem
*
newValidTakePhotoItem
=
new
SimpleMissionItem
(
_offlineVehicle
,
this
);
newValidTakePhotoItem
->
missionItem
()
=
_validTakePhotoItem
->
missionItem
();
...
...
@@ -1088,40 +962,6 @@ void CameraSectionTest::_testScanForTakePhotoSection(void)
QCOMPARE
(
_cameraSection
->
scanForSection
(
&
visualItems
,
scanIndex
),
false
);
QCOMPARE
(
visualItems
.
count
(),
1
);
visualItems
.
clear
();
/*
invalidSimpleItem.missionItem() = _validTimeItem->missionItem();
invalidSimpleItem.missionItem().setParam4(10); // must be -1 for highest res
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validTimeItem->missionItem();
invalidSimpleItem.missionItem().setParam5(10); // must be -1 for highest res
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validTimeItem->missionItem();
invalidSimpleItem.missionItem().setParam6(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
invalidSimpleItem.missionItem() = _validTimeItem->missionItem();
invalidSimpleItem.missionItem().setParam7(10); // must be 0
visualItems.append(&invalidSimpleItem);
QCOMPARE(_cameraSection->scanForSection(&visualItems, scanIndex), false);
QCOMPARE(visualItems.count(), 1);
QCOMPARE(_cameraSection->settingsSpecified(), false);
visualItems.clear();
*/
}
void
CameraSectionTest
::
_validateItemScan
(
SimpleMissionItem
*
validItem
)
...
...
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