547df8910094fbf7dc49f554a0c302372a5f4421
[openflowjava.git] / third-party / openflow-codec / src / test / java / org / openflow / codec / util / U8Test.java
1 package org.openflow.codec.util;
2
3 import org.openflow.codec.util.U8;
4
5 import junit.framework.TestCase;
6
7 public class U8Test extends TestCase {
8     /**
9      * Tests that we correctly translate unsigned values in and out of a byte
10      *
11      * @throws Exception
12      */
13     public void test() throws Exception {
14         short val = 0xff;
15         TestCase.assertEquals(-1, U8.t(val));
16         TestCase.assertEquals(val, U8.f((byte) -1));
17     }
18 }