diff options
author | Anton Tananaev <anton@traccar.org> | 2022-06-29 17:03:23 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-06-29 17:03:23 -0700 |
commit | aed0411f4ae5cfc007d27e0521a39a242fab7840 (patch) | |
tree | a704e82dc4c82e0d128e9619290ebb5cb8a66ea1 /src/test/java | |
parent | 8921fc12ea0590c290f3780fa20df7176b8c0000 (diff) | |
download | trackermap-server-aed0411f4ae5cfc007d27e0521a39a242fab7840.tar.gz trackermap-server-aed0411f4ae5cfc007d27e0521a39a242fab7840.tar.bz2 trackermap-server-aed0411f4ae5cfc007d27e0521a39a242fab7840.zip |
Unify signed magnitude int decoding
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/traccar/helper/BufferUtilTest.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/helper/BufferUtilTest.java b/src/test/java/org/traccar/helper/BufferUtilTest.java index b539b5b28..0196cef9d 100644 --- a/src/test/java/org/traccar/helper/BufferUtilTest.java +++ b/src/test/java/org/traccar/helper/BufferUtilTest.java @@ -11,6 +11,12 @@ import static org.junit.Assert.assertEquals; public class BufferUtilTest { @Test + public void testReadSignedMagnitudeInt() { + ByteBuf buf = Unpooled.wrappedBuffer(DataConverter.parseHex("80000001")); + assertEquals(-1, BufferUtil.readSignedMagnitudeInt(buf)); + } + + @Test public void test1() { ByteBuf buf = Unpooled.copiedBuffer("abcdef", StandardCharsets.US_ASCII); assertEquals(2, BufferUtil.indexOf("cd", buf)); |