Пример #1
0
        public void TestUInt24()
        {
            var rnd = new System.Random();

            for (var c = 0; c < count; c++)
            {
                var mem   = new byte[sizeof(UInt24) * writeRepeatCount];
                var span1 = new SpanStream(mem);
                var span2 = new SpanStream(mem);
                var a     = new UInt24[writeRepeatCount];

                for (var i = 0; i < writeRepeatCount; i++)
                {
                    var n = rnd.NextUInt32().ToUInt24();
                    a[i] = n;
                    span1.Write(n);
                }

                for (var i = 0; i < writeRepeatCount; i++)
                {
                    var r = span2.ReadUInt24();
                    Assert.Equal(a[i], r);
                }
            }
        }