mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-10-04 19:42:01 +08:00
36 lines
1.1 KiB
Java
36 lines
1.1 KiB
Java
package encoding;
|
|
|
|
import org.junit.Test;
|
|
import static org.junit.Assert.*;
|
|
|
|
import java.math.BigInteger;
|
|
|
|
/*
|
|
* @Author: hongyu guo
|
|
* @Description: 测试SizeT
|
|
* @Version: 1.0.0
|
|
* @Date: 21:27 2021/03/02
|
|
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
|
|
*/
|
|
public class TestSizeT {
|
|
|
|
public static void main(String[] args){
|
|
// BigInteger bigInteger=new BigInteger("3");
|
|
// VlInt vlInt=new VlInt(bigInteger);
|
|
// System.out.println(vlInt.isEqual(2));
|
|
byte[] b1 = new byte[]{(byte) 0xf1, (byte) 0xff, (byte) 0xff};//241,0,127
|
|
SizeT start1 = new SizeT(b1);
|
|
System.out.println("VlIntBytes:"+start1.getVlIntBytes().length);
|
|
System.out.println("VlIntValue:"+start1.getVlIntValue());
|
|
System.out.println(start1.toString());
|
|
}
|
|
|
|
@Test
|
|
public void testIsEqual(){
|
|
BigInteger bigInteger = new BigInteger("3");
|
|
SizeT vlInt = new SizeT(bigInteger);
|
|
assertFalse(vlInt.isEqual(2));
|
|
assertTrue(vlInt.isEqual(3));
|
|
}
|
|
}
|