aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-09-29 09:28:53 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-09-29 09:28:53 -0700
commit1e06b00e5f6068a191d0652798f12df77f0b0e0a (patch)
tree76b5f0f009d66017f445f57101b96a094cdf962c /src/test/java/org/traccar
parentc7e630f4904e073127c573951336be25735bf687 (diff)
downloadtrackermap-server-1e06b00e5f6068a191d0652798f12df77f0b0e0a.tar.gz
trackermap-server-1e06b00e5f6068a191d0652798f12df77f0b0e0a.tar.bz2
trackermap-server-1e06b00e5f6068a191d0652798f12df77f0b0e0a.zip
Handle long OBD values
Diffstat (limited to 'src/test/java/org/traccar')
-rw-r--r--src/test/java/org/traccar/helper/ObdDecoderTest.java10
-rw-r--r--src/test/java/org/traccar/protocol/UlbotechProtocolDecoderTest.java3
2 files changed, 8 insertions, 5 deletions
diff --git a/src/test/java/org/traccar/helper/ObdDecoderTest.java b/src/test/java/org/traccar/helper/ObdDecoderTest.java
index 1ffe68c8b..d5071bd51 100644
--- a/src/test/java/org/traccar/helper/ObdDecoderTest.java
+++ b/src/test/java/org/traccar/helper/ObdDecoderTest.java
@@ -9,11 +9,11 @@ public class ObdDecoderTest {
@Test
public void testDecode() {
- assertEquals(83, ObdDecoder.decode(0x01, "057b").getValue());
- assertEquals(1225, ObdDecoder.decode(0x01, "0C1324").getValue());
- assertEquals(20, ObdDecoder.decode(0x01, "0D14").getValue());
- assertEquals(64050, ObdDecoder.decode(0x01, "31fa32").getValue());
- assertEquals(25, ObdDecoder.decode(0x01, "2F41").getValue());
+ assertEquals(83L, ObdDecoder.decode(0x01, "057b").getValue());
+ assertEquals(1225L, ObdDecoder.decode(0x01, "0C1324").getValue());
+ assertEquals(20L, ObdDecoder.decode(0x01, "0D14").getValue());
+ assertEquals(64050L, ObdDecoder.decode(0x01, "31fa32").getValue());
+ assertEquals(25L, ObdDecoder.decode(0x01, "2F41").getValue());
}
diff --git a/src/test/java/org/traccar/protocol/UlbotechProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/UlbotechProtocolDecoderTest.java
index 8c820183b..a2bc1b46e 100644
--- a/src/test/java/org/traccar/protocol/UlbotechProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/UlbotechProtocolDecoderTest.java
@@ -10,6 +10,9 @@ public class UlbotechProtocolDecoderTest extends ProtocolTest {
UlbotechProtocolDecoder decoder = new UlbotechProtocolDecoder(null);
+ verifyPosition(decoder, binary(
+ "f801010353323083177450a703f6f0010efe55a31a0923d01400050070007003040a42000004040070cca00506039b1876220f060800000000000000000725310553410c0c9e310d05310f4641100440311119411f00476101810f8000310487411f00480804203a14c009033320159310f8"));
+
verifyNull(decoder, buffer(
"*TS01,353323081464660#"));