diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-02-02 15:36:54 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-02-02 15:36:54 -0800 |
commit | ee1dbcf048a922b6023b0714989b454b7dfe9587 (patch) | |
tree | 96e3d5f379e6151a12a7f608143faf088c37076b /src/test/java/org/traccar/helper | |
parent | 75e5eded6c877577044e9db22cae255cac8d04a1 (diff) | |
download | trackermap-server-ee1dbcf048a922b6023b0714989b454b7dfe9587.tar.gz trackermap-server-ee1dbcf048a922b6023b0714989b454b7dfe9587.tar.bz2 trackermap-server-ee1dbcf048a922b6023b0714989b454b7dfe9587.zip |
Fix merge issues
Diffstat (limited to 'src/test/java/org/traccar/helper')
-rw-r--r-- | src/test/java/org/traccar/helper/ChecksumTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/helper/ChecksumTest.java b/src/test/java/org/traccar/helper/ChecksumTest.java index 5737b9ff5..ff48527bc 100644 --- a/src/test/java/org/traccar/helper/ChecksumTest.java +++ b/src/test/java/org/traccar/helper/ChecksumTest.java @@ -4,6 +4,7 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import org.junit.Test; +import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import static org.junit.Assert.assertEquals; @@ -36,4 +37,13 @@ public class ChecksumTest { assertEquals(0, Checksum.luhn(63070019470771L)); } + @Test + public void testModulo256() { + assertEquals(0x00, Checksum.modulo256(ByteBuffer.wrap(new byte[] {0x00}))); + assertEquals(0x00, Checksum.modulo256(ByteBuffer.wrap(new byte[] {0x00, 0x00, 0x00}))); + assertEquals(0xca, Checksum.modulo256(ByteBuffer.wrap(new byte[] {0x77, 0x77, 0x77, 0x77, 0x77, 0x77}))); + + + } + } |