d220733c48ab39db512d1777f8605eb44a643fd3
[openflowjava.git] / third-party / openflow-codec / src / test / java / org / openflow / codec / util / U64Test.java
1 package org.openflow.codec.util;
2
3 import java.math.BigInteger;
4
5 import org.openflow.codec.util.U64;
6
7 import junit.framework.TestCase;
8
9 public class U64Test extends TestCase {
10     /**
11      * Tests that we correctly translate unsigned values in and out of a long
12      *
13      * @throws Exception
14      */
15     public void test() throws Exception {
16         BigInteger val = new BigInteger("ffffffffffffffff", 16);
17         TestCase.assertEquals(-1, U64.t(val));
18         TestCase.assertEquals(val, U64.f(-1));
19     }
20 }