CF/BF - Update re-instated unit tests due to rc_modes changes.

This commit is contained in:
Hydra 2017-06-17 21:02:59 +01:00 committed by Michael Keller
parent 75511249d8
commit 0227b7fb28
5 changed files with 17 additions and 2 deletions

View File

@ -309,10 +309,11 @@ TEST(FlightFailsafeTest, TestFailsafeDetectsKillswitchEvent)
// and
throttleStatus = THROTTLE_HIGH; // throttle HIGH to go for a failsafe landing procedure
failsafeConfigMutable()->failsafe_kill_switch = true; // configure AUX switch as kill switch
boxBitmask_t newMask;
memset(&newMask, 0, sizeof(newMask));
bitArraySet(&newMask, BOXFAILSAFE);
rcModeUpdate(&newMask); // activate BOXFAILSAFE mode
sysTickUptime = 0; // restart time from 0
failsafeOnValidDataReceived(); // set last valid sample at current time
sysTickUptime = PERIOD_RXDATA_FAILURE + 1; // adjust time to point just past the failure time to
@ -332,7 +333,8 @@ TEST(FlightFailsafeTest, TestFailsafeDetectsKillswitchEvent)
sysTickUptime += PERIOD_RXDATA_RECOVERY + 1; // adjust time to point just past the recovery time to
failsafeOnValidDataReceived(); // cause a recovered link
memset(&rcModeActivationMask, 0, sizeof(rcModeActivationMask)); // BOXFAILSAFE must be off (kill switch)
memset(&newMask, 0, sizeof(newMask));
rcModeUpdate(&newMask); // BOXFAILSAFE must be off (kill switch)
// when
failsafeUpdateState();

View File

@ -43,6 +43,7 @@ extern "C" {
#include "fc/runtime_config.h"
#include "fc/rc_controls.h"
#include "fc/rc_modes.h"
#include "rx/rx.h"
@ -234,6 +235,11 @@ bool sensors(uint32_t mask)
return false;
};
bool feature(uint32_t mask) {
UNUSED(mask);
return false;
}
uint32_t millis(void) { return 0; }
uint32_t micros(void) { return 0; }

View File

@ -35,6 +35,7 @@ extern "C" {
#include "fc/config.h"
#include "fc/rc_controls.h"
#include "fc/rc_modes.h"
#include "fc/runtime_config.h"
#include "drivers/light_ws2811strip.h"

View File

@ -28,6 +28,7 @@ extern "C" {
#include "telemetry/ibus_shared.h"
#include "telemetry/telemetry.h"
#include "fc/rc_controls.h"
#include "fc/rc_modes.h"
#include "sensors/barometer.h"
#include "sensors/battery.h"
}

View File

@ -217,5 +217,10 @@ void failsafeOnValidDataFailed(void)
{
}
bool IS_RC_MODE_ACTIVE(boxId_e)
{
return false;
}
}