aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-03-12 22:13:04 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-03-12 22:13:04 +1300
commitef05289a39c6ffedd123e1a50bbac7857719ea95 (patch)
treecd9cb140f16bafe5b04e29455fd336cf5940fdf6
parentc87fd6136bd6ec7afda1b93d5665881b06a3185a (diff)
downloadtrackermap-server-ef05289a39c6ffedd123e1a50bbac7857719ea95.tar.gz
trackermap-server-ef05289a39c6ffedd123e1a50bbac7857719ea95.tar.bz2
trackermap-server-ef05289a39c6ffedd123e1a50bbac7857719ea95.zip
Add GPS103 unit test
-rw-r--r--src/org/traccar/protocol/Gps103ProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/Gps103ProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Gps103ProtocolDecoder.java b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
index 1c1dbba47..2069634d6 100644
--- a/src/org/traccar/protocol/Gps103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gps103ProtocolDecoder.java
@@ -51,7 +51,7 @@ public class Gps103ProtocolDecoder extends BaseProtocolDecoder {
"([NS])," +
"(\\d+)(\\d{2}\\.\\d+)," + // Longitude (DDDMM.MMMM)
"([EW])?," +
- "(\\d+\\.?\\d*)?,?" + // Speed
+ "(\\d+\\.?\\d*)?,?" + // Speed
"(\\d+\\.?\\d*)?,?" + // Course
"(\\d+\\.?\\d*)?,?" + // Altitude
"([^,]+)?,?" +
diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java
index 756c0a5cb..7416672f0 100644
--- a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java
@@ -35,6 +35,9 @@ public class Gps103ProtocolDecoderTest {
verify(decoder.decode(null, null, null,
"imei:359587016817564,tracker,1301251602,,F,080251.000,A,3223.5832,N,11058.9449,W,0.03,"));
+
+ verify(decoder.decode(null, null, null,
+ "imei:359587016817564,tracker,1301251602,,F,080251.000,A,3223.5832,N,11058.9449,W,,"));
verify(decoder.decode(null, null, null,
"imei:012497000208821,tracker,1301080525,,F,212511.000,A,2228.5279,S,06855.6328,W,18.62,268.98,"));