add error handle: ComponentException & PacketException

This commit is contained in:
free will committed 2021-03-24 11:14:54 +08:00
1 parent d7f063cbb9
commit 7bf0906291
35 files changed
+955 -362

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package encoding;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/*
* @Author: Wang Feng
* @Description:
* @Version: 1.0.0
* @Date: 20:59 2021/3/23
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
*/
public class TLVTest {
@Test
public void testReadVarNumber() throws TLVException {
byte[] buf=new byte[10];
// 测试单个字节表示
buf[0]=(byte)240;
VlInt res=TLV.readVarNumber(buf,new VlInt(0));
assertTrue(res.isEqual(240));
// assertEquals();
}
}