From 1ea6535b83faa03c6f3e10b16848386b2ed34785 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Thu, 25 Aug 2022 23:55:42 -0400 Subject: [PATCH] two bugs love to cancel each other --- firmware/controllers/lua/lua_lib.h | 2 +- unit_tests/tests/lua/test_lua_vag.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/controllers/lua/lua_lib.h b/firmware/controllers/lua/lua_lib.h index c86bf7587c..17ccc2f856 100644 --- a/firmware/controllers/lua/lua_lib.h +++ b/firmware/controllers/lua/lua_lib.h @@ -6,7 +6,7 @@ \ local index = 1 \ while data1[index] ~= nil do \ - if data1[index] ~= data1[index] then \ + if data1[index] ~= data2[index] then \ return -1 - index \ end \ index = index + 1 \ diff --git a/unit_tests/tests/lua/test_lua_vag.cpp b/unit_tests/tests/lua/test_lua_vag.cpp index 15c01374b7..c7d8aced63 100644 --- a/unit_tests/tests/lua/test_lua_vag.cpp +++ b/unit_tests/tests/lua/test_lua_vag.cpp @@ -29,7 +29,7 @@ TEST(LuaVag, packMotor1) { data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } setTwoBytes(data, 2, 4 * rpm) - expected = { 0x00, 0x00, 0xDF, 0x12, 0x00, 0x00, 0x00, 0x00 } + expected = { 0x00, 0x00, 0xDC, 0x12, 0x00, 0x00, 0x00, 0x00 } -- print(data) return equals(data, expected) end