diff options
author | Ivan Muratov <binakot@gmail.com> | 2017-07-13 08:45:18 +0300 |
---|---|---|
committer | Ivan Muratov <binakot@gmail.com> | 2017-07-13 08:45:18 +0300 |
commit | 93227f9bffdfce2f1d60a61ea88f4eb152dfada5 (patch) | |
tree | c55745c3ebf2c09acd2d784f828c79e2f3e588c6 /test/org/traccar/helper | |
parent | 85f7eae47ec4bf6b269305a05a696f9acce31fd5 (diff) | |
parent | 358b591bc457786927ac1466e10181bbffbcf56b (diff) | |
download | trackermap-server-93227f9bffdfce2f1d60a61ea88f4eb152dfada5.tar.gz trackermap-server-93227f9bffdfce2f1d60a61ea88f4eb152dfada5.tar.bz2 trackermap-server-93227f9bffdfce2f1d60a61ea88f4eb152dfada5.zip |
Merge branch 'arnavi4_impl'
Diffstat (limited to 'test/org/traccar/helper')
-rw-r--r-- | test/org/traccar/helper/ChecksumTest.java | 8 |
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)); + } + } |