VAG Lua progress

This commit is contained in:
Andrey 2022-06-22 22:22:49 -04:00
parent 273303c38d
commit e4cd9d567d
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#include "pch.h"
#include "rusefi_lua.h"
#define VAG_CHECKSUM "function xorChecksum(data) \
return data[1] ~ data[2] ~ data[3] ~ data[4] ~ data[5] ~ data[6] ~ data[7] \
end"
TEST(LuaVag, Checksum) {
const char* realdata = VAG_CHECKSUM R"(
function testFunc()
data = { 0xE0, 0x20, 0x20, 0x7E, 0xFE, 0xFF, 0xFF, 0x60 }
return xorChecksum(data)
end
)";
EXPECT_NEAR_M3(testLuaReturnsNumberOrNil(realdata).value_or(0), 0x60);
}

View File

@ -31,6 +31,7 @@ TESTS_SRC_CPP = \
tests/lua/test_lua_basic.cpp \
tests/lua/test_lookup.cpp \
tests/lua/test_lua_e65.cpp \
tests/lua/test_lua_vag.cpp \
tests/lua/test_lua_with_engine.cpp \
tests/lua/test_lua_hooks.cpp \
tests/sensor/test_cj125.cpp \