aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/helper/BufferUtilTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/traccar/helper/BufferUtilTest.java')
-rw-r--r--src/test/java/org/traccar/helper/BufferUtilTest.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/test/java/org/traccar/helper/BufferUtilTest.java b/src/test/java/org/traccar/helper/BufferUtilTest.java
index b539b5b28..707e419ec 100644
--- a/src/test/java/org/traccar/helper/BufferUtilTest.java
+++ b/src/test/java/org/traccar/helper/BufferUtilTest.java
@@ -2,15 +2,21 @@ package org.traccar.helper;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.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));