package org.traccar.helper;

import org.jboss.netty.buffer.ChannelBuffers;

import static org.junit.Assert.*;
import org.junit.Test;

public class ChannelBufferToolsTest {
    
    @Test
    public void testReadHexInteger() {
        byte[] buf = {0x01, (byte) 0x90, 0x34};
        int result = ChannelBufferTools.readHexInteger(
                ChannelBuffers.wrappedBuffer(buf), 5);
        assertEquals(1903, result);
    }

}

@@ -72,23 +72,15 @@
 rs;%0A
-%0A
 import 
-static 
 org.
@@ -95,10 +95,8 @@
 sert
-.*
 ;%0Aim
@@ -376,16 +376,23 @@
         
+Assert.
 assertEq
@@ -418,10 +418,294 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testReadCoordinate() %7B%0A        byte%5B%5D buf = %7B0x03, (byte) 0x85, 0x22, 0x59, 0x34%7D;%0A        double result = ChannelBufferTools.readCoordinate(%0A                ChannelBuffers.wrappedBuffer(buf));%0A        Assert.assertEquals(38.870989, result, 0.00001);%0A    %7D%0A%0A
 %7D%0A

Add channel buffer tools test