only:kia CAN

This commit is contained in:
Andrey 2023-07-07 23:36:23 -04:00
parent 24763c4a62
commit 8d7794a265
2 changed files with 3 additions and 3 deletions

View File

@ -124,7 +124,7 @@ end \
"
#define HYUNDAI_SUM_NIBBLES "\
function hyuindaiSumNibbles(seed) \
function hyuindaiSumNibbles(data, seed) \
local sum = seed \
for i = 1, 7, 1 \
do \

View File

@ -31,10 +31,10 @@ rpm = 990
}
TEST(LuaKia, calcSumOfNibbles) {
#define real81Packet "\ndata = { 0x40, 0x85, 0x5F, 0x00, 0x00, 0x00, 0x00, 0xED}\n "
#define real81Packet "\npacket = { 0x40, 0x85, 0x5F, 0x00, 0x00, 0x00, 0x00, 0xED}\n "
const char* script = HYUNDAI_SUM_NIBBLES real81Packet R"(
function testFunc()
return hyuindaiSumNibbles(0xD)
return hyuindaiSumNibbles(packet, 0xD)
end
)";
EXPECT_NEAR_M3(testLuaReturnsNumberOrNil(script).value_or(0), 0xE);