aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/helper/ChecksumTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/org/traccar/helper/ChecksumTest.java b/test/org/traccar/helper/ChecksumTest.java
index c37eda88d..737b65c62 100644
--- a/test/org/traccar/helper/ChecksumTest.java
+++ b/test/org/traccar/helper/ChecksumTest.java
@@ -4,6 +4,7 @@ import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Assert;
import org.junit.Test;
+import org.traccar.protocol.Arnavi4ProtocolDecoder;
import java.nio.charset.StandardCharsets;
@@ -28,4 +29,11 @@ public class ChecksumTest {
Assert.assertEquals(0, Checksum.luhn(63070019470771L));
}
+ @Test
+ public void testModulo256() {
+ Assert.assertEquals(0x00, Checksum.modulo256((byte)0x00));
+ Assert.assertEquals(0x00, Checksum.modulo256((byte)0x00, (byte)0x00, (byte)0x00));
+ Assert.assertEquals(0x06, Checksum.modulo256((byte)0x01, (byte)0x02, (byte)0x03));
+ }
+
}