aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/helper/ChecksumTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar/helper/ChecksumTest.java')
-rw-r--r--test/org/traccar/helper/ChecksumTest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/org/traccar/helper/ChecksumTest.java b/test/org/traccar/helper/ChecksumTest.java
index c37eda88d..c7c5031df 100644
--- a/test/org/traccar/helper/ChecksumTest.java
+++ b/test/org/traccar/helper/ChecksumTest.java
@@ -28,4 +28,11 @@ public class ChecksumTest {
Assert.assertEquals(0, Checksum.luhn(63070019470771L));
}
+ @Test
+ public void testModulo256() {
+ Assert.assertEquals(0x00, Checksum.modulo256(new byte[] {0x00}));
+ Assert.assertEquals(0x00, Checksum.modulo256(new byte[] {0x00, 0x00, 0x00}));
+ Assert.assertEquals(0x06, Checksum.modulo256(new byte[] {0x01, 0x02, 0x03}));
+ }
+
}