1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-16 21:05:26 +03:00
This commit is contained in:
bsongis 2014-07-21 22:25:55 +02:00
parent 4d5962b15b
commit 45abfb872f
3 changed files with 135 additions and 2 deletions

View file

@ -60,4 +60,19 @@ TEST(Lua, testSetModelId)
EXPECT_EQ(g_model.header.modelId, 2);
}
TEST(Lua, testSetTelemetryChannel)
{
luaExecStr("channel = model.getTelemetryChannel(0)");
luaExecStr("channel.range = 100.0");
luaExecStr("channel.offset = -10.0");
luaExecStr("channel.alarm1 = 60");
luaExecStr("channel.alarm2 = 50");
luaExecStr("model.setTelemetryChannel(0, channel)");
EXPECT_EQ(g_model.frsky.channels[0].multiplier, 2);
EXPECT_EQ(g_model.frsky.channels[0].ratio, 250);
EXPECT_EQ(g_model.frsky.channels[0].offset, -26);
EXPECT_EQ(g_model.frsky.channels[0].alarms_value[0], 179);
EXPECT_EQ(g_model.frsky.channels[0].alarms_value[1], 153);
}
#endif