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
919b6fed
Commit
919b6fed
authored
Apr 24, 2016
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3209 from haigithub/master
Fix windows build bug, about MissionItemTest. Fix Survey delete bug.
parents
c588d119
995bfffb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
35 deletions
+38
-35
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+1
-1
MissionItemTest.cc
src/MissionManager/MissionItemTest.cc
+37
-34
No files found.
src/MissionEditor/MissionEditor.qml
View file @
919b6fed
...
...
@@ -507,7 +507,7 @@ QGCView {
onRemove
:
{
itemDragger
.
clearItem
()
controller
.
removeMissionItem
(
object
.
sequenceNumber
)
controller
.
removeMissionItem
(
index
)
}
onInsert
:
{
...
...
src/MissionManager/MissionItemTest.cc
View file @
919b6fed
...
...
@@ -281,20 +281,20 @@ void MissionItemTest::_testLoadFromJson(void)
{
MissionItem
missionItem
;
QString
errorString
;
QJsonArray
coordinateArray
=
{
-
10.0
,
-
20.0
,
-
30.0
}
;
QJsonObject
jsonObject
{
{
"autoContinue"
,
true
},
{
"command"
,
80
},
{
"frame"
,
3
},
{
"id"
,
10
},
{
"param1"
,
10
},
{
"param2"
,
20
},
{
"param3"
,
30
},
{
"param4"
,
40
},
{
"type"
,
"missionItem"
},
{
"coordinate"
,
coordinateArray
},
};
QJsonArray
coordinateArray
;
coordinateArray
<<
-
10.0
<<
-
20.0
<<-
30.0
;
QJsonObject
jsonObject
;
jsonObject
.
insert
(
"autoContinue"
,
true
);
jsonObject
.
insert
(
"command"
,
80
);
jsonObject
.
insert
(
"frame"
,
3
);
jsonObject
.
insert
(
"id"
,
10
);
jsonObject
.
insert
(
"param1"
,
10
);
jsonObject
.
insert
(
"param2"
,
20
);
jsonObject
.
insert
(
"param3"
,
30
);
jsonObject
.
insert
(
"param4"
,
40
);
jsonObject
.
insert
(
"type"
,
"missionItem"
);
jsonObject
.
insert
(
"coordinate"
,
coordinateArray
);
// Test missing key detection
...
...
@@ -317,7 +317,8 @@ void MissionItemTest::_testLoadFromJson(void)
QVERIFY
(
!
errorString
.
isEmpty
());
qDebug
()
<<
errorString
;
QJsonArray
badCoordinateArray
=
{
-
10.0
,
-
20.0
};
QJsonArray
badCoordinateArray
;
badCoordinateArray
<<
-
10.0
<<
-
20.0
;
badObject
=
jsonObject
;
badObject
.
remove
(
"coordinate"
);
badObject
[
"coordinate"
]
=
badCoordinateArray
;
...
...
@@ -325,19 +326,22 @@ void MissionItemTest::_testLoadFromJson(void)
QVERIFY
(
!
errorString
.
isEmpty
());
qDebug
()
<<
errorString
;
badCoordinateArray
=
{
-
10.0
,
-
20.0
,
true
};
QJsonArray
badCoordinateArray_second
;
badCoordinateArray_second
<<
-
10.0
<<
-
20.0
<<
true
;
badObject
=
jsonObject
;
badObject
.
remove
(
"coordinate"
);
badObject
[
"coordinate"
]
=
badCoordinateArray
;
badObject
[
"coordinate"
]
=
badCoordinateArray
_second
;
QCOMPARE
(
missionItem
.
load
(
badObject
,
errorString
),
false
);
QVERIFY
(
!
errorString
.
isEmpty
());
qDebug
()
<<
errorString
;
QJsonArray
badCoordinateArray2
=
{
1
,
2
};
badCoordinateArray
=
{
-
10.0
,
-
20.0
,
badCoordinateArray2
};
QJsonArray
badCoordinateArray2
;
badCoordinateArray2
<<
1
<<
2
;
QJsonArray
badCoordinateArray_third
;
badCoordinateArray_third
<<
-
10.0
<<
-
20.0
<<
badCoordinateArray2
;
badObject
=
jsonObject
;
badObject
.
remove
(
"coordinate"
);
badObject
[
"coordinate"
]
=
badCoordinateArray
;
badObject
[
"coordinate"
]
=
badCoordinateArray
_third
;
QCOMPARE
(
missionItem
.
load
(
badObject
,
errorString
),
false
);
QVERIFY
(
!
errorString
.
isEmpty
());
qDebug
()
<<
errorString
;
...
...
@@ -364,20 +368,19 @@ void MissionItemTest::_testSimpleLoadFromJson(void)
SimpleMissionItem
simpleMissionItem
(
NULL
);
QString
errorString
;
QJsonArray
coordinateArray
=
{
-
10.0
,
-
20.0
,
-
30.0
};
QJsonObject
jsonObject
{
{
"autoContinue"
,
true
},
{
"command"
,
80
},
{
"frame"
,
3
},
{
"id"
,
10
},
{
"param1"
,
10
},
{
"param2"
,
20
},
{
"param3"
,
30
},
{
"param4"
,
40
},
{
"type"
,
"missionItem"
},
{
"coordinate"
,
coordinateArray
},
};
QJsonArray
coordinateArray
;
coordinateArray
<<
-
10.0
<<
-
20.0
<<
-
30.0
;
QJsonObject
jsonObject
;
jsonObject
.
insert
(
"autoContinue"
,
true
);
jsonObject
.
insert
(
"command"
,
80
);
jsonObject
.
insert
(
"frame"
,
3
);
jsonObject
.
insert
(
"id"
,
10
);
jsonObject
.
insert
(
"param1"
,
10
);
jsonObject
.
insert
(
"param2"
,
20
);
jsonObject
.
insert
(
"param3"
,
30
);
jsonObject
.
insert
(
"param4"
,
40
);
jsonObject
.
insert
(
"type"
,
"missionItem"
);
jsonObject
.
insert
(
"coordinate"
,
coordinateArray
);
QVERIFY
(
simpleMissionItem
.
load
(
jsonObject
,
errorString
));
...
...
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