Ejemplo n.º 1
0
        public void AMF_DecodeInt24Test()
        {
            uint expected = 0x123456;
            var  buf      = new byte[100];

            AMF.AMF_EncodeInt24(buf, 0, buf.Length, expected);
            var actual = AMF.AMF_DecodeInt24(buf);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void AMF_EncodeInt24Test()
        {
            int val = 0x123456;

            byte[] buf = new byte[100];
            int    enc = 0, pend = buf.Length;

            enc = AMF.AMF_EncodeInt24(buf, enc, pend, (uint)val);
            Assert.AreEqual(3, enc, "result");
            Assert.AreEqual(0x12, buf[0], "0");
            Assert.AreEqual(0x34, buf[1], "1");
            Assert.AreEqual(0x56, buf[2], "2");
        }