Exemplo n.º 1
0
        public void SkipBitsTest(int value)
        {
            m_stream.Skip(5);
            m_stream.WriteInt32(value);
            Assert.AreEqual(37, m_stream.BitOffset);

            m_stream.ResetRead();
            m_stream.Skip(5);
            Assert.AreEqual(value, m_stream.ReadInt32());
            Assert.AreEqual(37, m_stream.BitOffset);
        }
Exemplo n.º 2
0
        public void ZeroLargeTest()
        {
            BitStreamer bs = new BitStreamer();

            bs.ResetWrite(8);

            Assert.AreEqual(8, bs.ByteLength);

            bs.Skip(20 << 3);

            Assert.AreEqual(24, bs.ByteLength);
        }
Exemplo n.º 3
0
        public void Vector2Test()
        {
            Vector2 value = new Vector2(rnd.NextFloat(), rnd.NextFloat());

            stream.Skip(1);
            stream.WriteVector2(value);

            Assert.AreEqual(65, stream.BitOffset);
            stream.ResetRead();
            stream.Skip(1);

            Assert.AreEqual(value, stream.ReadVector2());
            Assert.AreEqual(65, stream.BitOffset);
        }