aboutsummaryrefslogtreecommitdiff
path: root/test/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-11-06 11:56:19 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-11-06 11:56:19 +1300
commit23f83e9f1c6c0f183256a3952a8b3a819dc0ea1c (patch)
tree6bc1a27981a68e9ac8936f30f6f2a0cd77e09bed /test/org
parent04a40e1cfb9484f3ab25a3390249355bc3e711ae (diff)
downloadtrackermap-server-23f83e9f1c6c0f183256a3952a8b3a819dc0ea1c.tar.gz
trackermap-server-23f83e9f1c6c0f183256a3952a8b3a819dc0ea1c.tar.bz2
trackermap-server-23f83e9f1c6c0f183256a3952a8b3a819dc0ea1c.zip
Finish OBD decoder implementation
Diffstat (limited to 'test/org')
-rw-r--r--test/org/traccar/helper/ObdDecoderTest.java7
-rw-r--r--test/org/traccar/protocol/UlbotechProtocolDecoderTest.java3
2 files changed, 10 insertions, 0 deletions
diff --git a/test/org/traccar/helper/ObdDecoderTest.java b/test/org/traccar/helper/ObdDecoderTest.java
index fb74f5d3c..238f3e0a6 100644
--- a/test/org/traccar/helper/ObdDecoderTest.java
+++ b/test/org/traccar/helper/ObdDecoderTest.java
@@ -7,6 +7,13 @@ public class ObdDecoderTest {
@Test
public void testDecode() {
+
+ Assert.assertEquals(83, ObdDecoder.decode(0x01, 0x05, "7b").getValue());
+ Assert.assertEquals(1225, ObdDecoder.decode(0x01, 0x0C, "1324").getValue());
+ Assert.assertEquals(20, ObdDecoder.decode(0x01, 0x0D, "14").getValue());
+ Assert.assertEquals(64050, ObdDecoder.decode(0x01, 0x31, "fa32").getValue());
+ Assert.assertEquals(25, ObdDecoder.decode(0x01, 0x2F, "41").getValue());
+
}
}
diff --git a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java
index 7e321fa8e..30e040e3d 100644
--- a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java
@@ -13,6 +13,9 @@ public class UlbotechProtocolDecoderTest extends ProtocolDecoderTest {
UlbotechProtocolDecoder decoder = new UlbotechProtocolDecoder(new UlbotechProtocol());
verifyPosition(decoder, binary(
+ "f8010108679650230651689dc8e45b010e01194a26fbd47fa6001f003c0054030402420000040400024d7b0506037c18692212071131057f410c0ee0310d1b312f41413112ef0804000dd59fcc32f8"));
+
+ verifyPosition(decoder, binary(
"f8010103596580419465449da89d16010efe5580fe0923d82100140129005903040242000004040001a7f10506037818be220e070e31057b410c1324310d144131fa3208040020b1418297f8"));
verifyPosition(decoder, binary(