aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavriel Fleischer <flocsy@gmail.com>2019-01-13 22:07:55 +0200
committerGavriel Fleischer <flocsy@gmail.com>2019-01-13 22:07:55 +0200
commit50eb6e7ec6364866e4934bb6fd1dd668e8e9fa69 (patch)
tree4af973597825bcf828603b8a9785bdc52fe99441
parent70fde7e4a19c9dbcde0a983711cf133e629f54f4 (diff)
downloadtrackermap-server-50eb6e7ec6364866e4934bb6fd1dd668e8e9fa69.tar.gz
trackermap-server-50eb6e7ec6364866e4934bb6fd1dd668e8e9fa69.tar.bz2
trackermap-server-50eb6e7ec6364866e4934bb6fd1dd668e8e9fa69.zip
added test when binary data looks like format string
-rw-r--r--test/org/traccar/protocol/WatchProtocolEncoderTest.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/WatchProtocolEncoderTest.java b/test/org/traccar/protocol/WatchProtocolEncoderTest.java
index d7784f50b..9b9e68cdb 100644
--- a/test/org/traccar/protocol/WatchProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/WatchProtocolEncoderTest.java
@@ -35,6 +35,12 @@ public class WatchProtocolEncoderTest extends ProtocolTest {
command = new Command();
command.setDeviceId(1);
+ command.setType(Command.TYPE_VOICE_MESSAGE);
+ command.set(Command.KEY_DATA, "2321414d520a2573");
+ assertEquals("[CS*123456789012345*000b*TK,#!AMR\n%s]", encoder.encodeCommand(null, command));
+
+ command = new Command();
+ command.setDeviceId(1);
command.setType(Command.TYPE_CUSTOM);
command.set(Command.KEY_DATA, "WORK,6-9,11-13,13-15,17-19");
assertEquals("[CS*123456789012345*001a*WORK,6-9,11-13,13-15,17-19]", encoder.encodeCommand(null, command));