From 9e3ef837bbcd83869a1230d0f744bc8d0567cc70 Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 11 Mar 2015 06:50:37 +0100 Subject: [PATCH] Google tests again ok (missing initialization) --- radio/src/tests/gtests.h | 7 +++++++ radio/src/tests/switches.cpp | 15 ++------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/radio/src/tests/gtests.h b/radio/src/tests/gtests.h index 464e69b4e..c151824da 100644 --- a/radio/src/tests/gtests.h +++ b/radio/src/tests/gtests.h @@ -15,6 +15,13 @@ extern uint16_t anaInValues[NUM_STICKS+NUM_POTS]; void doMixerCalculations(); +#if defined(PCBTARANIS) +#define RADIO_RESET() \ + g_eeGeneral.switchConfig = 0x00007bff +#else + #define RADIO_RESET() +#endif + inline void MODEL_RESET() { memset(&g_model, 0, sizeof(g_model)); diff --git a/radio/src/tests/switches.cpp b/radio/src/tests/switches.cpp index af976fe08..7cb7c4c78 100644 --- a/radio/src/tests/switches.cpp +++ b/radio/src/tests/switches.cpp @@ -34,19 +34,7 @@ * */ -#include -#include - -#define SWAP_DEFINED -#include "opentx.h" - -#define MODEL_RESET() \ - memset(&g_model, 0, sizeof(g_model)); \ - extern uint8_t s_mixer_first_run_done; \ - s_mixer_first_run_done = false; \ - lastFlightMode = 255; - -extern void MIXER_RESET(); +#include "gtests.h" #if !defined(PCBTARANIS) TEST(getSwitch, undefCSW) @@ -76,6 +64,7 @@ TEST(getSwitch, circularCSW) #if defined(PCBTARANIS) TEST(getSwitch, OldTypeStickyCSW) { + RADIO_RESET(); MODEL_RESET(); MIXER_RESET(); g_model.logicalSw[0] = { LS_FUNC_AND, SWSRC_SA0, 0, 0, };