things are a bit broken

This commit is contained in:
rusefillc 2024-05-15 15:45:35 -04:00
parent d249e28787
commit 63762e6900
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package com.rusefi.can.reader.dbc;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class DbcFieldTest {
@Test
public void testBigEndian() {
DbcField field = new DbcField("", 8, 16, 1, 0, null, true);
assertFalse(field.coversByte(0));
assertTrue(field.coversByte(1));
assertTrue(field.coversByte(2));
assertFalse(field.coversByte(3));
}
@Test
public void testLittleEndian() {
DbcField field = new DbcField("", 8, 16, 1, 0, null, false);
assertFalse(field.coversByte(0));
assertTrue(field.coversByte(1));
assertTrue(field.coversByte(2));
assertFalse(field.coversByte(3));
}
}