Add simple test for Gst.Base.ByteReader to the buffer tests
This commit is contained in:
parent
cf3ccdc914
commit
bc14e845a7
@ -70,5 +70,22 @@ public class BufferTest {
|
|||||||
Gst.Buffer buffer = new Gst.Buffer (data);
|
Gst.Buffer buffer = new Gst.Buffer (data);
|
||||||
|
|
||||||
ArrayIsEqual (data, buffer.ToByteArray ());
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user