From 63762e6900ad89bbdbace2f8cad8e2b2cb2bcb11 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Wed, 15 May 2024 15:45:35 -0400 Subject: [PATCH] things are a bit broken --- .../rusefi/can/reader/dbc/DbcFieldTest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 reader/src/test/java/com/rusefi/can/reader/dbc/DbcFieldTest.java diff --git a/reader/src/test/java/com/rusefi/can/reader/dbc/DbcFieldTest.java b/reader/src/test/java/com/rusefi/can/reader/dbc/DbcFieldTest.java new file mode 100644 index 0000000..df5bcf6 --- /dev/null +++ b/reader/src/test/java/com/rusefi/can/reader/dbc/DbcFieldTest.java @@ -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)); + } +}