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
fe6ee5b3
Commit
fe6ee5b3
authored
May 24, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unit test fixes
parent
74736dbb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
LinkInterface.h
src/comm/LinkInterface.h
+2
-0
UASUnitTest.cc
src/qgcunittest/UASUnitTest.cc
+6
-4
No files found.
src/comm/LinkInterface.h
View file @
fe6ee5b3
...
...
@@ -36,6 +36,7 @@ along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.
#include <QDateTime>
#include <QMutex>
#include <QMutexLocker>
#include <QMetaType>
/**
* The link interface defines the interface for all links used to communicate
...
...
@@ -62,6 +63,7 @@ public:
outDataWriteTimes
[
i
]
=
0
;
}
qRegisterMetaType
<
LinkInterface
*>
(
"LinkInterface*"
);
}
virtual
~
LinkInterface
()
{
...
...
src/qgcunittest/UASUnitTest.cc
View file @
fe6ee5b3
#include "UASUnitTest.h"
#include <stdio.h>
#include <QObject>
#include <QThread>
UASUnitTest
::
UASUnitTest
()
{
}
...
...
@@ -8,7 +10,7 @@ UASUnitTest::UASUnitTest()
void
UASUnitTest
::
init
()
{
mav
=
new
MAVLinkProtocol
();
uas
=
new
UAS
(
mav
,
UASID
);
uas
=
new
UAS
(
mav
,
QThread
::
currentThread
(),
UASID
);
uas
->
deleteSettings
();
}
//this function is called after every test
...
...
@@ -24,7 +26,7 @@ void UASUnitTest::cleanup()
void
UASUnitTest
::
getUASID_test
()
{
// Test a default ID of zero is assigned
UAS
*
uas2
=
new
UAS
(
mav
);
UAS
*
uas2
=
new
UAS
(
mav
,
QThread
::
currentThread
()
);
QCOMPARE
(
uas2
->
getUASID
(),
0
);
delete
uas2
;
...
...
@@ -49,7 +51,7 @@ void UASUnitTest::getUASName_test()
void
UASUnitTest
::
getUpTime_test
()
{
UAS
*
uas2
=
new
UAS
(
mav
);
UAS
*
uas2
=
new
UAS
(
mav
,
QThread
::
currentThread
()
);
// Test that the uptime starts at zero to a
// precision of seconds
QCOMPARE
(
floor
(
uas2
->
getUptime
()
/
1000.0
),
0.0
);
...
...
@@ -281,7 +283,7 @@ void UASUnitTest::signalWayPoint_test()
delete
uas
;
// delete(destroyed) uas for validating
uas
=
NULL
;
QCOMPARE
(
spyDestroyed
.
count
(),
1
);
// count destroyed uas should are 1
uas
=
new
UAS
(
mav
,
UASID
);
uas
=
new
UAS
(
mav
,
QThread
::
currentThread
(),
UASID
);
QSignalSpy
spy2
(
uas
->
getWaypointManager
(),
SIGNAL
(
waypointEditableListChanged
()));
QCOMPARE
(
spy2
.
count
(),
0
);
Waypoint
*
wp2
=
new
Waypoint
(
0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
0.0
,
false
,
false
,
MAV_FRAME_GLOBAL
,
MAV_CMD_MISSION_START
,
"blah"
);
...
...
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