diff options
Diffstat (limited to 'test/org/traccar/helper')
-rw-r--r-- | test/org/traccar/helper/ChannelBufferToolsTest.java | 11 |
1 files changed, 11 insertions, 0 deletions
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); + } } |