chore: add legacy_names to gtest (#5335)

This commit is contained in:
3djc
2024-07-29 10:40:30 +10:00
committed by GitHub
parent ca459bb91c
commit 09e2788b81
+24
View File
@@ -191,4 +191,28 @@ TEST(Lua, Switches)
luaExecStr("if MIXSRC_SB == nil then error('failed') end");
}
TEST(Lua, testLegacyNames)
{
MODEL_RESET();
#if defined(SURFACE_RADIO)
for (uint8_t i = 0; i < 2; i ++)
anaSetFiltered(i, -1024);
luaExecStr("value = getValue('thr')");
luaExecStr("if value ~= -1024 then error('th not defined in Legacy') end");
luaExecStr("value = getValue('ste')");
luaExecStr("if value ~= -1024 then error('st not defined in Legacy') end");
#else
for (uint8_t i = 0; i < 4; i ++)
anaSetFiltered(i, -1024);
luaExecStr("value = getValue('thr')");
luaExecStr("if value ~= -1024 then error('thr not defined in Legacy') end");
luaExecStr("value = getValue('ail')");
luaExecStr("if value ~= -1024 then error('ail not defined in Legacy') end");
luaExecStr("value = getValue('rud')");
luaExecStr("if value ~= -1024 then error('rud not defined in Legacy') end");
luaExecStr("value = getValue('ele')");
luaExecStr("if value ~= -1024 then error('ele not defined in Legacy') end");
#endif
}
#endif // #if defined(LUA)