2006-05-30 Michael Dominic K. <michaldominik@gmail.com>

* README:
	Fixing a broken svn link to gtk-sharp sources.

	* tests/CapsTest.cs:
	* tests/Makefile.am:
	Introducing a new test for Gst.Caps. All fixtures pass.



git-svn-id: svn://anonsvn.mono-project.com/source/branches/abock/gstreamer-sharp@61284 e3ebcda4-bce8-0310-ba0a-eca2169e7518
This commit is contained in:
Michael Dominic K 2006-05-30 20:10:57 +00:00
parent 8c72b3b631
commit ce927fccae
4 changed files with 99 additions and 2 deletions

View file

@ -1,3 +1,12 @@
2006-05-30 Michael Dominic K. <michaldominik@gmail.com>
* README:
Fixing a broken svn link to gtk-sharp sources.
* tests/CapsTest.cs:
* tests/Makefile.am:
Introducing a new test for Gst.Caps. All fixtures pass.
2006-05-25 Aaron Bockover <aaron@abock.org>
* gstreamer-sharp/Gstreamer.metadata: Hide the Children property and

2
README
View file

@ -17,7 +17,7 @@ To build gstreamer-sharp, you must have a subversion checkout of
gtk-sharp-2.0 and apply the gapi-fixup patch and install gapi-fixup:
$ cd ~/cvs/mono
$ svn co svn://svn.myrealbox.com/trunk/gtk-sharp
$ svn co svn://svn.myrealbox.com/source/trunk/gtk-sharp
$ cd gtk-sharp
$ patch -p0 < ~/cvs/mono/gstreamer-sharp/gtk-sharp-gapi-fixup.diff
$ ./bootstrap-2.8 --prefix=/usr

88
tests/CapsTest.cs Normal file
View file

@ -0,0 +1,88 @@
//
// CapsTest.cs: NUnit Test Suite for gstreamer-sharp
//
// Authors:
// Michael Dominic K. (michaldominik@gmail.com)
//
// (C) 2006 Novell, Inc.
//
using System;
using NUnit.Framework;
using Gst;
[TestFixture]
public class CapsTest
{
[TestFixtureSetUp]
public void Init()
{
Application.Init();
}
[TestFixtureTearDown]
public void Deinit()
{
Application.Deinit();
}
[Test]
public void TestPlainCreation()
{
Caps caps = new Caps();
Assert.IsNotNull(caps);
Assert.IsFalse(caps.Handle == IntPtr.Zero, "Ooops, null handle");
caps.Dispose();
}
[Test]
public void TestFromString()
{
Caps caps = Caps.FromString("video/x-raw-yuv, " +
"format=(fourcc)I420, " +
"width=(int)384, " +
"height=(int)288, " +
"framerate=(fraction)25/1");
Assert.IsNotNull(caps);
Assert.IsFalse(caps.Handle == IntPtr.Zero, "Ooops, null handle");
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]
public void TestIntersecting()
{
Caps caps1 = Caps.FromString("video/x-raw-yuv, " +
"format=(fourcc)I420, " +
"width=(int)[ 1,1000 ], " +
"height=(int)[ 1, 1000 ], " +
"framerate=(fraction)[ 0/1, 100/1 ]");
Caps caps2 = Caps.FromString("video/x-raw-yuv, " +
"format=(fourcc)I420, " +
"width=(int)640, " +
"height=(int)480");
Assert.IsNotNull(caps1);
Assert.IsNotNull(caps2);
Assert.IsFalse(caps1.Handle == IntPtr.Zero, "Ooops, null handle in caps1");
Assert.IsFalse(caps1.Handle == IntPtr.Zero, "Ooops, null handle in caps2");
Caps caps3 = caps1.Intersect(caps2);
Assert.IsFalse(caps3.IsFixed, "How come caps are FIXED?!");
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();
}
}

View file

@ -3,7 +3,7 @@ NUNIT_FLAGS = @MONO_NUNIT_LIBS@
ASSEMBLY_NAME = gstreamer-tests
ASSEMBLY = $(ASSEMBLY_NAME).dll
ASSEMBLY_CSFILES = $(srcdir)/ApplicationTest.cs $(srcdir)/BinTest.cs
ASSEMBLY_CSFILES = $(srcdir)/ApplicationTest.cs $(srcdir)/BinTest.cs $(srcdir)/CapsTest.cs
NUNIT_TESTER_NAME = ConsoleUi
NUNIT_TESTER = $(NUNIT_TESTER_NAME).exe