only: canam

This commit is contained in:
Andrey 2023-11-18 01:45:34 -05:00
parent 894fb7153c
commit cd19753a7d
1 changed files with 24 additions and 0 deletions

View File

@ -14,6 +14,30 @@ TEST(canam, ecu102_1) {
EXPECT_NEAR_M3(testLuaReturnsNumberOrNil(realdata).value_or(0), 0x45);
}
TEST(canam, bytes) {
const char* realdata = TWO_BYTES_MSB R"(
function testFunc()
data = {0x00, 0x00, 0x00, 0x00, 0x01, 0xc7, 0x00, 0xc6}
return getTwoBytesMSB(data, 4, 1)
end
)";
EXPECT_NEAR_M3(testLuaReturnsNumberOrNil(realdata).value_or(0), 455);
}
TEST(canam, bytes2) {
const char* realdata = TWO_BYTES_MSB R"(
function testFunc()
data = {0x00, 0x00, 0x04, 0xa2, 0x02, 0x6c, 0x00, 0x00}
return getTwoBytesMSB(data, 2, 1)
end
)";
EXPECT_NEAR_M3(testLuaReturnsNumberOrNil(realdata).value_or(0), 1186);
}
TEST(canam, ecu102_4) {
const char* realdata = VAG_CHECKSUM R"(