From bc14e845a7ac477b6303f4455ad5aee04410c139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 22 Sep 2009 07:55:02 +0200 Subject: [PATCH] Add simple test for Gst.Base.ByteReader to the buffer tests --- tests/BufferTest.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/BufferTest.cs b/tests/BufferTest.cs index 9123d419ca..5a6eef20dc 100644 --- a/tests/BufferTest.cs +++ b/tests/BufferTest.cs @@ -70,5 +70,22 @@ public class BufferTest { Gst.Buffer buffer = new Gst.Buffer (data); ArrayIsEqual (data, buffer.ToByteArray ()); + + Gst.Base.ByteReader reader = new Gst.Base.ByteReader (buffer); + byte b; + Assert.IsTrue (reader.GetUint8 (out b)); + Assert.IsTrue (b == 0 && 0 == data[reader.Pos-1]); + Assert.IsTrue (reader.GetUint8 (out b)); + Assert.IsTrue (b == 1 && 1 == data[reader.Pos-1]); + Assert.IsTrue (reader.GetUint8 (out b)); + Assert.IsTrue (b == 2 && 2 == data[reader.Pos-1]); + Assert.IsTrue (reader.GetUint8 (out b)); + Assert.IsTrue (b == 3 && 3 == data[reader.Pos-1]); + Assert.IsTrue (reader.GetUint8 (out b)); + Assert.IsTrue (b == 4 && 4 == data[reader.Pos-1]); + Assert.IsTrue (reader.GetUint8 (out b)); + Assert.IsTrue (b == 5 && 5 == data[reader.Pos-1]); + Assert.IsFalse (reader.GetUint8 (out b)); + Assert.IsTrue (reader.Pos == buffer.Size); } }