Skip to content

Commit

Permalink
chore: add legacy_names to gtest (EdgeTX#5335)
Browse files Browse the repository at this point in the history
  • Loading branch information
3djc authored Jul 29, 2024
1 parent ca459bb commit 09e2788
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions radio/src/tests/lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 09e2788

Please sign in to comment.