From 0af1cebf1e2f3f719edf5391252fcd4004a75157 Mon Sep 17 00:00:00 2001 From: user Date: Sun, 21 Oct 2012 21:42:46 +1300 Subject: JT600 protocol fix --- test/org/traccar/helper/ChannelBufferToolsTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/org/traccar/helper') diff --git a/test/org/traccar/helper/ChannelBufferToolsTest.java b/test/org/traccar/helper/ChannelBufferToolsTest.java index 16ff036b8..792770dab 100644 --- a/test/org/traccar/helper/ChannelBufferToolsTest.java +++ b/test/org/traccar/helper/ChannelBufferToolsTest.java @@ -20,4 +20,15 @@ public class ChannelBufferToolsTest { factory.getBuffer(buf, 0, buf.length), 5); assertEquals(1903, result); } + + @Test + public void testReadHexString() { + byte[] buf = {0x01,(byte)0x90,0x34}; + String result = ChannelBufferTools.readHexString( + factory.getBuffer(buf, 0, buf.length), 5); + assertEquals("01903", result); + + result = Long.valueOf(result).toString(); + assertEquals("1903", result); + } } -- cgit v1.2.3