mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 03:45:39 +00:00
Add unit test for managed buffer generation and interaction
This commit is contained in:
parent
63b7bcabd8
commit
89ffc66700
1 changed files with 20 additions and 0 deletions
|
@ -42,4 +42,24 @@ public class BufferTest
|
|||
Assert.IsFalse(sub1.IsSpanFast(buffer), "a parent buffer can not be SpanFasted");
|
||||
Assert.IsTrue(sub1.IsSpanFast(sub2), "two subbuffers next to each other should be SpanFast");
|
||||
}
|
||||
|
||||
private void ArrayIsEqual (byte[] a, byte[] b)
|
||||
{
|
||||
Assert.IsTrue (a.Length == b.Length);
|
||||
for (int i = 0; i < a.Length; i++)
|
||||
Assert.IsTrue (a[i] == b[i]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestBufferData()
|
||||
{
|
||||
byte[] data = new byte[] {0, 1, 2, 3, 4, 5};
|
||||
|
||||
Gst.Buffer buffer = new Gst.Buffer (data);
|
||||
|
||||
ArrayIsEqual (data, buffer.Data);
|
||||
for (uint i = 0; i < buffer.Size; i++)
|
||||
Assert.IsTrue (buffer[i] == data[i]);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue