yes we have a defect for sure!

This commit is contained in:
rusefillc 2024-02-16 00:25:15 -05:00
parent 749f8a2858
commit fa68d54687
1 changed files with 4 additions and 1 deletions

View File

@ -24,7 +24,7 @@ public class GetValueFromTrcTest {
@Test
public void testBigEndian() {
byte[] data = {(byte) 0xAB, 0x56};
byte[] data = {(byte) 0xAB, 0x56, 0x34};
// hmmm
assertEquals(0x56AB, DbcField.getBitRange(data, 0, 16, false));
assertEquals(0xAB56, DbcField.getBitRange(data, 8, 16, true));
@ -34,6 +34,9 @@ public class GetValueFromTrcTest {
assertEquals(0x56, DbcField.getBitRange(data, 8, 8, false));
assertEquals(0x56, DbcField.getBitRange(data, 8, 8, true));
// yes we have a defect for sure, we only touch two bytes at most while in this case we shall touch three bytes
assertEquals(0x56A, DbcField.getBitRange(data, 4, 16, false));
}
@Test