Remove all the Refcount tests

The refcount of GstObjects isn't public anymore
and shouldn't be tested for anyway.
This commit is contained in:
Maarten Bosmans 2009-06-13 11:42:15 +02:00 committed by Sebastian Dröge
parent e04254c23e
commit 18682a3604
3 changed files with 0 additions and 184 deletions

View file

@ -22,37 +22,7 @@ public class BufferTest {
{ {
Application.Deinit(); Application.Deinit();
} }
/*
[Test]
public void TestCaps()
{
Gst.Buffer buffer = new Gst.Buffer(4);
Caps caps = Caps.FromString("audio/x-raw-int");
Assert.AreEqual(caps.Refcount, 1, "caps");
Assert.IsNull(buffer.Caps, "buffer.Caps is null???");
buffer.Caps = caps;
Assert.AreEqual(caps.Refcount, 2, "caps");
Caps caps2 = Caps.FromString("audio/x-raw-float");
Assert.AreEqual(caps2.Refcount, 1, "caps2");
buffer.Caps = caps2;
Assert.AreEqual(caps.Refcount, 1, "caps");
Assert.AreEqual(caps2.Refcount, 1, "caps2");
buffer.Caps = null;
Assert.AreEqual(caps.Refcount, 1, "caps");
Assert.AreEqual(caps2.Refcount, 1, "caps2");
buffer.Caps = caps2;
Assert.AreEqual(caps2.Refcount, 2, "caps2");
buffer.Dispose();
Assert.AreEqual(caps2.Refcount, 1, "caps2");
caps.Dispose();
caps2.Dispose();
}
*/
[Test] [Test]
public void TestSubbuffer() public void TestSubbuffer()
{ {
@ -60,8 +30,6 @@ public class BufferTest {
Gst.Buffer sub = buffer.CreateSub(1, 2); Gst.Buffer sub = buffer.CreateSub(1, 2);
Assert.IsNotNull(sub); Assert.IsNotNull(sub);
Assert.AreEqual(sub.Size, 2, "subbuffer has wrong size"); Assert.AreEqual(sub.Size, 2, "subbuffer has wrong size");
//Assert.AreEqual(buffer.Refcount, 2, "parent");
//Assert.AreEqual(sub.Refcount, 1, "subbuffer");
//sub.Dispose(); //sub.Dispose();
buffer.Dispose(); buffer.Dispose();

View file

@ -27,80 +27,6 @@ public class ElementTest
Application.Deinit(); Application.Deinit();
} }
[Test]
public void TestBinAdd()
{
Element src = ElementFactory.Make("fakesrc", null);
Element sink = ElementFactory.Make("fakesink", null);
Assert.AreEqual(src.Refcount, 1, "fakesrc");
Assert.AreEqual(sink.Refcount, 1, "fakesink");
Element pipeline = new Pipeline(String.Empty);
Assert.AreEqual(pipeline.Refcount, 1, "pipeline");
Bin bin = (Bin) pipeline;
Assert.AreEqual(bin.Refcount, 1, "bin");
Assert.AreEqual(pipeline.Refcount, 1, "pipeline");
bin.AddMany(src, sink);
Assert.AreEqual(src.Refcount, 2, "src");
Assert.AreEqual(sink.Refcount, 2, "sink");
Assert.AreEqual(bin.Refcount, 1, "bin");
Assert.AreEqual(pipeline.Refcount, 1, "pipeline");
src.Link(sink);
src.Dispose();
sink.Dispose();
pipeline.Dispose();
}
[Test]
public void TestAddRemovePad()
{
Element e = ElementFactory.Make("fakesrc", "source");
Pad p = new Pad("source", PadDirection.Src);
Assert.AreEqual(p.Refcount, 1, "pad");
e.AddPad(p);
Assert.AreEqual(p.Refcount, 2, "pad");
e.RemovePad(p);
p.Dispose();
e.Dispose();
}
[Test]
public void TestAddPadUnrefElement ()
{
Element e = ElementFactory.Make("fakesrc", "source");
Assert.IsNotNull(e, "Could not create fakesrc");
Assert.IsTrue(e.GetType() == typeof(Gst.Element));
Assert.AreEqual(e.Refcount, 1);
Pad p = new Pad("source", PadDirection.Src);
Assert.AreEqual(p.Refcount, 1, "pad");
Gst.Object.Ref(p.Handle);
Assert.AreEqual(p.Refcount, 2, "pad");
e.AddPad(p);
Assert.AreEqual(p.Refcount, 3, "pad");
Gst.Object.Unref(p.Handle);
Assert.AreEqual(p.Refcount, 2, "pad");
Assert.AreEqual(e.Refcount, 1);
e.Dispose();
Assert.AreEqual(p.Refcount, 1, "pad");
p.Dispose();
}
[Test] [Test]
public void TestErrorNoBus() public void TestErrorNoBus()
{ {
@ -108,54 +34,6 @@ public class ElementTest
e.Dispose(); e.Dispose();
} }
/*
[Test]
public void TestLink()
{
State state, pending;
Element source = ElementFactory.Make("fakesrc", "source");
Assert.IsNotNull(source);
Element sink = ElementFactory.Make("fakesink", "sink");
Assert.IsNotNull(sink);
Assert.AreEqual(source.Refcount, 1, source.Name);
Assert.AreEqual(sink.Refcount, 1, "sink");
Assert.IsTrue(source.LinkPads("src", sink, "sink"));
sink.SetState(State.Paused);
source.SetState(State.Paused);
Assert.AreEqual(source.Refcount, 1, "src");
Assert.AreEqual(sink.Refcount, 1, "sink");
sink.GetState(out state, out pending, Clock.TimeNone);
sink.SetState(State.Playing);
source.SetState(State.Playing);
// Sleep
System.Threading.Thread.Sleep(500);
sink.SetState(State.Paused);
source.SetState(State.Paused);
sink.GetState(out state, out pending, Clock.TimeNone);
Assert.AreEqual(sink.Refcount, 1, "sink");
Assert.AreEqual(source.Refcount, 1, "src");
source.UnlinkPads("src", sink, "sink");
Assert.AreEqual(sink.Refcount, 1, "sink");
Assert.AreEqual(source.Refcount, 1, "src");
source.Dispose();
sink.Dispose();
}
*/
[Test] [Test]
public void TestLinkNoPads() public void TestLinkNoPads()
{ {

View file

@ -91,24 +91,6 @@ public class PipelineTest
pipeline.Dispose(); pipeline.Dispose();
} }
[Test]
public void TestGetBus()
{
Pipeline pipeline = new Pipeline(String.Empty);
Assert.IsNotNull(pipeline, "Could not create pipeline");
Assert.AreEqual(pipeline.Refcount, 1, "Refcount is not 1, it is " + pipeline.Refcount);
Bus bus = pipeline.Bus;
Assert.AreEqual(pipeline.Refcount, 1, "Refcount after .Bus");
Assert.AreEqual(bus.Refcount, 2, "bus.Refcount != 2, it is " + bus.Refcount);
pipeline.Dispose();
Assert.AreEqual(bus.Refcount, 1, "bus after unref pipeline");
bus.Dispose();
}
Element pipeline; Element pipeline;
GLib.MainLoop loop; GLib.MainLoop loop;
@ -148,14 +130,6 @@ public class PipelineTest
bin.AddMany(src, sink); bin.AddMany(src, sink);
Assert.IsTrue(src.Link(sink), "Could not link between src and sink"); Assert.IsTrue(src.Link(sink), "Could not link between src and sink");
Bus bus = ((Pipeline)pipeline).Bus;
Assert.AreEqual(pipeline.Refcount, 1, "pipeline's refcount after .Bus");
Assert.AreEqual(bus.Refcount, 2, "bus");
uint id = bus.AddWatch(new BusFunc(MessageReceived));
Assert.AreEqual(pipeline.Refcount, 1, "pipeline after AddWatch");
Assert.AreEqual(bus.Refcount, 3, "bus after add_watch");
Assert.AreEqual(pipeline.SetState(State.Playing), StateChangeReturn.Async); Assert.AreEqual(pipeline.SetState(State.Playing), StateChangeReturn.Async);
loop = new GLib.MainLoop(); loop = new GLib.MainLoop();
@ -166,11 +140,7 @@ public class PipelineTest
Assert.AreEqual(pipeline.GetState(out current, out pending, Clock.TimeNone), StateChangeReturn.Success); Assert.AreEqual(pipeline.GetState(out current, out pending, Clock.TimeNone), StateChangeReturn.Success);
Assert.AreEqual(current, State.Null, "state is not NULL but " + current); Assert.AreEqual(current, State.Null, "state is not NULL but " + current);
Assert.AreEqual(pipeline.Refcount, 1, "pipeline at start of cleanup");
Assert.AreEqual(bus.Refcount, 3, "bus at start of cleanup");
pipeline.Dispose(); pipeline.Dispose();
bus.Dispose();
} }
[Test] [Test]