Skip to content

Commit

Permalink
fix: mixer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcoeffic committed May 27, 2023
1 parent af6898d commit 4c39db4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions radio/src/tests/mixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ class MixerTest : public OpenTxTest {};
} \
} while (0)

#define MIXSRC_Ele (MIXSRC_FIRST_STICK + 1)
#define MIXSRC_Ail (MIXSRC_FIRST_STICK + 3)

#define MIXSRC_TrimEle (MIXSRC_FIRST_TRIM + 1)
#define MIXSRC_TrimThr (MIXSRC_FIRST_TRIM + 2)

#define MIXSRC_CYC1 (MIXSRC_FIRST_HELI)
#define MIXSRC_CYC2 (MIXSRC_FIRST_HELI + 1)
#define MIXSRC_CYC3 (MIXSRC_FIRST_HELI + 2)

TEST_F(TrimsTest, throttleTrim)
{
g_model.thrTrim = 1;
Expand Down Expand Up @@ -722,7 +732,9 @@ TEST(Heli, BasicTest)
g_model.mixData[2].mltpx = MLTPX_ADD;
g_model.mixData[2].srcRaw = MIXSRC_CYC3;
g_model.mixData[2].weight = 100;
anaSetFiltered(THR_STICK, 0);
anaSetFiltered(ELE_STICK, 1024);
anaSetFiltered(AIL_STICK, 0);
evalFlightModeMixes(e_perout_mode_normal, 0);
EXPECT_EQ(chans[0], -CHANNEL_MAX);
EXPECT_EQ(chans[1], CHANNEL_MAX/2);
Expand Down Expand Up @@ -756,7 +768,9 @@ TEST(Heli, Mode2Test)
g_model.mixData[2].mltpx = MLTPX_ADD;
g_model.mixData[2].srcRaw = MIXSRC_CYC3;
g_model.mixData[2].weight = 100;
anaSetFiltered(THR_STICK, 0);
anaSetFiltered(ELE_STICK, 1024);
anaSetFiltered(AIL_STICK, 0);
evalFlightModeMixes(e_perout_mode_normal, 0);
EXPECT_EQ(chans[0], -CHANNEL_MAX);
EXPECT_EQ(chans[1], CHANNEL_MAX/2);
Expand Down

0 comments on commit 4c39db4

Please sign in to comment.