1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-23 16:25:16 +03:00

HELI simple automatic test added for testing Pull request #1129

This commit is contained in:
bsongis 2014-05-28 12:30:30 +02:00
parent ce0f6c33be
commit 023b3ac17c

View file

@ -849,6 +849,44 @@ TEST(Curves, LinearIntpol)
EXPECT_EQ(applyCustomCurve(-192, 0), -192);
}
#if defined(HELI) && defined(PCBTARANIS)
TEST(Heli, BasicTest)
{
MODEL_RESET();
applyDefaultTemplate();
g_model.swashR.collectiveSource = MIXSRC_Thr;
g_model.swashR.type = SWASH_TYPE_120;
g_model.mixData[0].destCh = 0;
g_model.mixData[0].mltpx = MLTPX_ADD;
g_model.mixData[0].srcRaw = MIXSRC_CYC1;
g_model.mixData[0].weight = 100;
g_model.mixData[1].destCh = 1;
g_model.mixData[1].mltpx = MLTPX_ADD;
g_model.mixData[1].srcRaw = MIXSRC_CYC2;
g_model.mixData[1].weight = 100;
g_model.mixData[2].destCh = 2;
g_model.mixData[2].mltpx = MLTPX_ADD;
g_model.mixData[2].srcRaw = MIXSRC_CYC3;
g_model.mixData[2].weight = 100;
anaInValues[ELE_STICK] = 1024;
evalFlightModeMixes(e_perout_mode_normal, 0);
EXPECT_EQ(chans[0], -CHANNEL_MAX);
EXPECT_EQ(chans[1], CHANNEL_MAX/2);
EXPECT_EQ(chans[2], CHANNEL_MAX/2);
}
#elif defined(HELI)
TEST(Heli, BasicTest)
{
MODEL_RESET();
applyTemplate(TMPL_HELI_SETUP);
anaInValues[ELE_STICK] = 1024;
evalFlightModeMixes(e_perout_mode_normal, 0);
EXPECT_EQ(chans[0], -CHANNEL_MAX);
EXPECT_EQ(chans[1], CHANNEL_MAX/2);
EXPECT_EQ(chans[1], CHANNEL_MAX/2);
}
#endif
int main(int argc, char **argv) {
StartEepromThread(NULL);
g_menuStackPtr = 0;