diff --git a/unit_tests/tests/lua/test_motorola_dbc.cpp b/unit_tests/tests/lua/test_motorola_dbc.cpp index be47056e2f..5526a25605 100644 --- a/unit_tests/tests/lua/test_motorola_dbc.cpp +++ b/unit_tests/tests/lua/test_motorola_dbc.cpp @@ -226,6 +226,8 @@ namespace { } TEST_F(MotorolaDbcTest, testNewMessage006) { + std::array data { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + const int bitStart = 13; const int length = 8; @@ -243,12 +245,14 @@ namespace { // u 6 | // m 7 | // . 8 | - EXPECT_EQ(getBitRangeMoto(getTestDataPtr(), bitStart, length), 0x00); // 0000 + EXPECT_EQ(getBitRangeMoto(data.data(), bitStart, length), 0x00); // 0000 const int testValue = 0xB3; // 1011 0011 + setBitRangeMoto(data.data(), bitStart, length, testValue); - ASSERT_EQ(22, motorolaMagicFromDbc(bitStart, length)); - setBitRangeMoto(getTestDataPtr(), bitStart, length, testValue); + const std::array unexpectedData = { 0x00, 0x00, 0xC2, 0x00, 0x00, 0x00, 0x00, 0x00 }; + EXPECT_THAT(data, testing::ElementsAreArray(unexpectedData)); // TODO: this check shouldn't pass!!! + EXPECT_EQ(getBitRangeMoto(data.data(), bitStart, length), 0x03); // TODO: this check shouldn't pass!!! //// | Bit Positions //// | 7 6 5 4 3 2 1 0 @@ -263,11 +267,8 @@ namespace { //// m 7 | 0 0 0 0 0 0 0 0 //// . 8 | 0 0 0 0 0 0 0 0 //const std::array expectedData = { 0x00, 0x00, 0x2C, 0xC0, 0x00, 0x00, 0x00, 0x00 }; // TODO: these are expected data!!! - //EXPECT_THAT(testData, testing::ElementsAreArray(expectedData)); // TODO: this check shouldn't fail!!! - //EXPECT_EQ(getBitRangeMoto(getTestDataPtr(), bitStart, length), testValue); // TODO: this check shouldn't fail!!! - - const std::array unexpectedData = { 0x00, 0x00, 0xC2, 0x00, 0x00, 0x00, 0x00, 0x00 }; - EXPECT_THAT(testData, testing::ElementsAreArray(unexpectedData)); // TODO: this check shouldn't pass!!! + //EXPECT_THAT(data, testing::ElementsAreArray(expectedData)); // TODO: this check shouldn't fail!!! + //EXPECT_EQ(getBitRangeMoto(data.data(), bitStart, length), testValue); // TODO: this check shouldn't fail!!! // checkRange( // /* bitStart = */ 13,