diff --git a/src/qgcunittest/UASUnitTest.cc b/src/qgcunittest/UASUnitTest.cc index b6c11b0f9284e938b2b6e1a673e7822a7a5d6ae4..2fc948c2469a59f471e6e5726b4008507405137f 100644 --- a/src/qgcunittest/UASUnitTest.cc +++ b/src/qgcunittest/UASUnitTest.cc @@ -73,15 +73,20 @@ void UASUnitTest::getCommunicationStatus_test() void UASUnitTest::filterVoltage_test() { 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() { int type = uas->getAutopilotType(); // Verify that upon construction the autopilot is set to -1 QCOMPARE(type, -1); } + void UASUnitTest::setAutopilotType_test() { uas->setAutopilotType(2);