From f100210c37b5a5980fb779f9f6ef2c0274151b92 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Mon, 15 Jun 2009 08:32:28 +0200 Subject: [PATCH] Remove Dispose() calls in each test --- tests/BinTest.cs | 15 --------------- tests/BufferTest.cs | 5 ----- tests/CapsTest.cs | 12 ------------ tests/ElementTest.cs | 4 ---- tests/MessageTest.cs | 2 -- tests/PadTest.cs | 35 ----------------------------------- tests/PipelineTest.cs | 15 --------------- 7 files changed, 88 deletions(-) diff --git a/tests/BinTest.cs b/tests/BinTest.cs index 594ce5bab7..3bab91d551 100644 --- a/tests/BinTest.cs +++ b/tests/BinTest.cs @@ -42,10 +42,6 @@ public class BinTest bin.AddMany(e1, e2); Assert.AreEqual(bin.ChildrenCount, 2); - - e2.Dispose(); - e1.Dispose(); - bin.Dispose(); } @@ -60,9 +56,6 @@ public class BinTest Assert.IsNotNull(e1); Assert.AreEqual(e1.Name, "element-name"); - - e1.Dispose(); - bin.Dispose(); } [Test] @@ -87,11 +80,6 @@ public class BinTest for(int i = 0; i < elements.Length; i++) { Assert.AreEqual(elements[elements.Length - i - 1], children[i]); } - - bin.Dispose(); - - foreach(Element e in elements) - e.Dispose(); } [Test] @@ -104,9 +92,6 @@ public class BinTest Assert.IsNotNull(filesrc, "Could not create filesrc"); bin.Add(filesrc); - - filesrc.Dispose(); - bin.Dispose(); } } diff --git a/tests/BufferTest.cs b/tests/BufferTest.cs index 4f2b60d552..d1173c72a8 100644 --- a/tests/BufferTest.cs +++ b/tests/BufferTest.cs @@ -30,9 +30,6 @@ public class BufferTest { Gst.Buffer sub = buffer.CreateSub(1, 2); Assert.IsNotNull(sub); Assert.AreEqual(sub.Size, 2, "subbuffer has wrong size"); - - //sub.Dispose(); - buffer.Dispose(); } [Test] @@ -49,8 +46,6 @@ public class BufferTest { Assert.IsFalse(buffer.IsSpanFast(sub2), "a parent buffer can not be SpanFasted"); 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"); - - buffer.Dispose(); } } diff --git a/tests/CapsTest.cs b/tests/CapsTest.cs index 14c57c4cf6..c724aedc63 100644 --- a/tests/CapsTest.cs +++ b/tests/CapsTest.cs @@ -33,8 +33,6 @@ public class CapsTest Caps caps = new Caps(); Assert.IsNotNull(caps); Assert.IsFalse(caps.Handle == IntPtr.Zero, "Ooops, null handle"); - - caps.Dispose(); } [Test] @@ -51,8 +49,6 @@ public class CapsTest Assert.IsTrue(caps.IsFixed, "Caps should be FIXED!"); Assert.IsFalse(caps.IsEmpty, "Caps shouldn't be EMPTY!"); Assert.IsFalse(caps.IsAny, "Caps shouldn't be ANY!"); - - caps.Dispose(); } [Test] @@ -79,10 +75,6 @@ public class CapsTest Assert.IsFalse(caps3.IsEmpty, "How come caps are EMPTY?!"); Assert.AreEqual(caps2.ToString() + ", framerate=(fraction)[ 0/1, 100/1 ]", caps3.ToString()); - - caps1.Dispose(); - caps2.Dispose(); - caps3.Dispose(); } [Test] @@ -111,10 +103,6 @@ public class CapsTest "format=(fourcc)I420, " + "height=(int)480", caps3.ToString()); - - caps1.Dispose(); - caps2.Dispose(); - caps3.Dispose(); } } diff --git a/tests/ElementTest.cs b/tests/ElementTest.cs index 7f812b38c4..bc20d97997 100644 --- a/tests/ElementTest.cs +++ b/tests/ElementTest.cs @@ -31,7 +31,6 @@ public class ElementTest public void TestErrorNoBus() { Element e = ElementFactory.Make("fakesrc", "source"); - e.Dispose(); } [Test] @@ -41,9 +40,6 @@ public class ElementTest Element sink = new Bin("sink"); Assert.IsFalse(src.Link(sink)); - - src.Dispose(); - sink.Dispose(); } } diff --git a/tests/MessageTest.cs b/tests/MessageTest.cs index 67edaa119b..1e454bed51 100644 --- a/tests/MessageTest.cs +++ b/tests/MessageTest.cs @@ -29,12 +29,10 @@ public class MessageTest { Assert.IsNotNull(message); Assert.AreEqual(message.Type, MessageType.Eos); Assert.IsNull(message.Src); - message.Dispose(); message = new Message(null, "error string"); Assert.IsNotNull(message); Assert.AreEqual(message.Type, MessageType.Error); Assert.IsNull(message.Src); - message.Dispose(); } } diff --git a/tests/PadTest.cs b/tests/PadTest.cs index 9bf5718829..b5b2173240 100644 --- a/tests/PadTest.cs +++ b/tests/PadTest.cs @@ -42,9 +42,6 @@ public class PadTest Assert.AreEqual(PadDirection.Src, src.Direction); Assert.AreEqual(PadDirection.Sink, sink.Direction); - - src.Dispose(); - sink.Dispose(); } public static Caps PadGetCapsStub(Pad pad) @@ -63,9 +60,6 @@ public class PadTest Assert.IsNotNull(caps, "Ooops, returned caps is null"); Assert.IsFalse(caps.IsEmpty == true, "Ooops, returned caps are empty"); Assert.AreEqual("video/x-raw-yuv", caps.ToString ()); - - caps.Dispose(); - src.Dispose(); } [Test] @@ -89,12 +83,6 @@ public class PadTest Caps sinkcaps = sink.Caps; Assert.IsTrue(sinkcaps.IsAny, "How come sink pad caps is not ANY?"); - - element.Dispose(); - src.Dispose(); - sink.Dispose(); - srccaps.Dispose(); - sinkcaps.Dispose(); } [Test] @@ -120,8 +108,6 @@ public class PadTest Assert.IsTrue(hassink, "Sink pad not found in the list"); Assert.IsTrue(hassrc, "Src pad not found in the list"); - - element.Dispose(); } [Test] @@ -137,9 +123,6 @@ public class PadTest Assert.IsNotNull(sink, "Pad could not be created"); Assert.AreEqual(src.Link(sink), PadLinkReturn.Noformat); - - sink.Dispose(); - src.Dispose(); } [Test] @@ -155,8 +138,6 @@ public class PadTest catch (Exception ex) { Assert.Fail("buffer.AllowedCaps failed"); } - - buffer.Dispose(); */ Pad sink = new Pad("sink", PadDirection.Sink); // try { Caps tcaps = sink.AllowedCaps; } @@ -178,15 +159,6 @@ public class PadTest Caps gotcaps = src.AllowedCaps; Assert.IsNotNull(gotcaps); Assert.IsTrue(gotcaps.IsEqual(caps)); - - gotcaps.Dispose(); - - src.Unlink(sink); - - src.Dispose(); - sink.Dispose(); - - caps.Dispose(); } bool ProbeHandler(Pad pad, Gst.Buffer buffer) @@ -208,16 +180,9 @@ public class PadTest Gst.Buffer buffer = new Gst.Buffer(); Assert.AreEqual(src.Push(buffer), FlowReturn.NotLinked); - buffer.Dispose(); ulong handler_id = src.AddBufferProbe(new Pad.BufferProbeDelegate(ProbeHandler)); buffer = new Gst.Buffer(); Assert.AreEqual(src.Push(buffer), FlowReturn.Ok); - buffer.Dispose(); - src.RemoveBufferProbe((uint)handler_id); - - src.Dispose(); - - caps.Dispose(); } } diff --git a/tests/PipelineTest.cs b/tests/PipelineTest.cs index c3bf1869e2..6261e5212c 100644 --- a/tests/PipelineTest.cs +++ b/tests/PipelineTest.cs @@ -34,8 +34,6 @@ public class PipelineTest Assert.IsNotNull(pipeline, "Could not create pipeline"); Assert.AreEqual(((Element)pipeline).SetState(State.Playing), StateChangeReturn.Success); - - pipeline.Dispose(); } [Test] @@ -50,10 +48,6 @@ public class PipelineTest src.Link(sink); Assert.AreEqual(((Element)pipeline).SetState(State.Ready), StateChangeReturn.Success); - - pipeline.Dispose(); - src.Dispose(); - sink.Dispose(); } [Test] @@ -82,13 +76,10 @@ public class PipelineTest //Console.WriteLine("state change from {0} to {1}", old, newState); if(message.Src == (Gst.Object) pipeline && newState == State.Playing) done = true; - //message.Dispose(); } } Assert.AreEqual(((Element)pipeline).SetState(State.Null), StateChangeReturn.Success); - //bus.Dispose(); - pipeline.Dispose(); } Element pipeline; @@ -139,8 +130,6 @@ public class PipelineTest State current, pending; Assert.AreEqual(pipeline.GetState(out current, out pending, Clock.TimeNone), StateChangeReturn.Success); Assert.AreEqual(current, State.Null, "state is not NULL but " + current); - - pipeline.Dispose(); } [Test] @@ -160,9 +149,5 @@ public class PipelineTest Assert.IsTrue(fakesrc.Link(fakesink)); Pad sink = fakesink.GetPad("sink"); - - pipeline.Dispose(); - fakesrc.Dispose(); - fakesink.Dispose(); } }