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
3500a39d
Commit
3500a39d
authored
Jan 12, 2011
by
INIDETAM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding methods to test unit
parent
768fed96
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
2 deletions
+93
-2
tst_uasunittest.cc
qgcunittest/tst_uasunittest.cc
+91
-0
SlugsMAV.h
src/uas/SlugsMAV.h
+1
-1
UAS.h
src/uas/UAS.h
+1
-1
No files found.
qgcunittest/tst_uasunittest.cc
View file @
3500a39d
...
...
@@ -21,6 +21,21 @@ private Q_SLOTS:
void
getUASName_test
();
void
getUpTime_test
();
void
getCommunicationStatus_test
();
void
filterVoltage_test
();
void
getAutopilotType_test
();
void
setAutopilotType_test
();
void
getStatusForCode_test
();
void
getLocalX_test
();
void
getLocalY_test
();
void
getLocalZ_test
();
void
getLatitude_test
();
void
getLongitude_test
();
void
getAltitude_test
();
void
getRoll_test
();
void
getPitch_test
();
void
getYaw_test
();
void
calculateTimeRemaining_test
();
private:
...
...
@@ -90,6 +105,82 @@ void UASUnitTest::getCommunicationStatus_test()
QCOMPARE
(
uas
->
getCommunicationStatus
(),
static_cast
<
int
>
(
UASInterface
::
COMM_DISCONNECTED
));
}
void
UASUnitTest
::
filterVoltage_test
()
{
float
verificar
=
uas
->
filterVoltage
(
0.4
f
);
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
verificar
,
8.52
f
);
}
void
UASUnitTest
::
getAutopilotType_test
()
{
int
verificar
=
uas
->
getAutopilotType
();
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
verificar
,
-
1
);
}
void
UASUnitTest
::
setAutopilotType_test
()
{
uas
->
setAutopilotType
(
2
);
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getAutopilotType
(),
2
);
}
void
UASUnitTest
::
getStatusForCode_test
()
{
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getYaw
(),
0.0
);
}
void
UASUnitTest
::
getLocalX_test
()
{
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getLocalX
(),
0.0
);
}
void
UASUnitTest
::
getLocalY_test
()
{
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getLocalY
(),
0.0
);
}
void
UASUnitTest
::
getLocalZ_test
()
{
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getLocalZ
(),
0.0
);
}
void
UASUnitTest
::
getLatitude_test
()
{
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getLatitude
(),
0.0
);
}
void
UASUnitTest
::
getLongitude_test
()
{
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getLongitude
(),
0.0
);
}
void
UASUnitTest
::
getAltitude_test
()
{
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getAltitude
(),
0.0
);
}
void
UASUnitTest
::
getRoll_test
()
{
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getRoll
(),
0.0
);
}
void
UASUnitTest
::
getPitch_test
()
{
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getPitch
(),
0.0
);
}
void
UASUnitTest
::
getYaw_test
()
{
// Verify that upon construction the Comm status is disconnected
QCOMPARE
(
uas
->
getYaw
(),
0.0
);
}
void
UASUnitTest
::
calculateTimeRemaining_test
()
{
/*
*/
}
QTEST_APPLESS_MAIN
(
UASUnitTest
);
#include "tst_uasunittest.moc"
src/uas/SlugsMAV.h
View file @
3500a39d
...
...
@@ -44,7 +44,7 @@ public slots:
void
emitSignals
(
void
);
mavlink_pwm_commands_t
*
getPwmCommands
();
//
mavlink_pwm_commands_t* getPwmCommands();
signals:
...
...
src/uas/UAS.h
View file @
3500a39d
...
...
@@ -92,7 +92,7 @@ public:
friend
class
UASWaypointManager
;
protected:
protected:
//COMMENTS FOR TEST UNIT
int
uasId
;
///< Unique system ID
unsigned
char
type
;
///< UAS type (from type enum)
quint64
startTime
;
///< The time the UAS was switched on
...
...
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