aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/helper/ChannelBufferToolsTest.java
blob: 6e2c6310ca90613a700990cb6f062265409030ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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);
    }

}