Remove Dispose() calls in each test

This commit is contained in:
Maarten Bosmans 2009-06-15 08:32:28 +02:00 committed by Sebastian Dröge
parent 18682a3604
commit f100210c37
7 changed files with 0 additions and 88 deletions

View file

@ -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();
}
}

View file

@ -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();
}
}

View file

@ -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();
}
}

View file

@ -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();
}
}

View file

@ -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();
}
}

View file

@ -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();
}
}

View file

@ -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();
}
}