Commit 33983aa7 authored by Don Gagne's avatar Don Gagne

Merge pull request #656 from DonLakeFlyer/UASUnitTest

Fix UAS unit test for range and voltage change
parents 8f6e8117 fc369c16
...@@ -73,15 +73,20 @@ void UASUnitTest::getCommunicationStatus_test() ...@@ -73,15 +73,20 @@ void UASUnitTest::getCommunicationStatus_test()
void UASUnitTest::filterVoltage_test() void UASUnitTest::filterVoltage_test()
{ {
float verificar=uas->filterVoltage(0.4f); float verificar=uas->filterVoltage(0.4f);
// Verify that upon construction the Comm status is disconnected
QCOMPARE(verificar, 8.52f); // We allow the voltage returned to be within a small delta
const float allowedDelta = 0.05f;
const float desiredVoltage = 7.36f;
QVERIFY(verificar > (desiredVoltage - allowedDelta) && verificar < (desiredVoltage + allowedDelta));
} }
void UASUnitTest:: getAutopilotType_test() void UASUnitTest:: getAutopilotType_test()
{ {
int type = uas->getAutopilotType(); int type = uas->getAutopilotType();
// Verify that upon construction the autopilot is set to -1 // Verify that upon construction the autopilot is set to -1
QCOMPARE(type, -1); QCOMPARE(type, -1);
} }
void UASUnitTest::setAutopilotType_test() void UASUnitTest::setAutopilotType_test()
{ {
uas->setAutopilotType(2); uas->setAutopilotType(2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment