custom-board-bundle-sample-.../unit_tests/tests/lua/test_lua_nissan.cpp

16 lines
440 B
C++
Raw Normal View History

2022-11-12 10:06:55 -08:00
#include "pch.h"
#include "rusefi_lua.h"
#include "lua_lib.h"
2022-11-23 20:45:25 -08:00
TEST(LuaNissan, wheelSpeed) {
#define realWheelPacket "\ndata = { 0x19, 0x6c, 0x19, 0x68, 0x0e, 0xb0, 0x37, 0x81}\n "
const char* script = TWO_BYTES_MSB realWheelPacket R"(
function testFunc()
engineTorque = getTwoBytesMSB(data, 0, 0.005)
return engineTorque
end
)";
2022-11-12 10:06:55 -08:00
2022-11-23 20:45:25 -08:00
EXPECT_NEAR_M3(testLuaReturnsNumberOrNil(script).value_or(0), 32.54);
2022-11-12 10:06:55 -08:00
}