Exemple #1
0
        public void testRecycleHeader()
        {
            //ByteBuffer b = ByteBuffer.wrap(sampleInit, 0, 12);
            ByteBuffer b  = ByteBuffer.wrap(sampleInit);
            Packet     p  = new NonvalidatingPacket(b);
            ByteBuffer bb = p.getByteBuffer();

            Assert.AreEqual(Packet.getHex(b), Packet.getHex(bb), "Expecting same content in packets ");
        }
Exemple #2
0
        public void testValidHeader()
        {
            ByteBuffer b = ByteBuffer.wrap(sampleInit);
            Packet     p = new NonvalidatingPacket(b);

            Assert.AreEqual(5000, p.getDestPort(), "DestPort should be 5000");
            Assert.AreEqual(5000, p.getSrcPort(), "SrcPort should be 5000");
            Assert.AreEqual(0, p.getVerTag(), "verTag should be 0");
        }
Exemple #3
0
        public void testShortHeader()
        {
            ByteBuffer b = new ByteBuffer(new byte[1]);
            Exception  x = null;

            try {
                Packet p = new NonvalidatingPacket(b);
            }
            catch (Exception e) {
                x = e;
            }
            Assert.AreEqual(false, (x == null), "Exception should be thrown ");
            Assert.AreEqual(x.GetType(), typeof(SctpPacketFormatException), "Expecting exception SctpPacketException ");
        }