bit math is hard :(

This commit is contained in:
rusefillc 2022-06-20 21:51:08 -04:00
parent c0144a5614
commit e793124f8d
1 changed files with 11 additions and 0 deletions

View File

@ -125,6 +125,17 @@ TEST(LuaE65, gearTorque2) {
EXPECT_NEAR_M3(testLuaReturnsNumberOrNil(realdata).value_or(0), 0x019F);
}
TEST(LuaE65, gearTorque3) {
const char* realdata = GET_BIT_RANGE R"(
function testFunc()
data = {0x9F, 0xDF, 0x32, 0x20, 0x23, 0x30, 0xFF, 0x43}
return getBitRange(data, 0, 16)
end)";
EXPECT_NEAR_M3(testLuaReturnsNumberOrNil(realdata).value_or(0), 0xDF9F);
}
TEST(LuaE65, sumChecksum) {
// checksum is first byte