Browse Source

More test cases

git-svn-id: https://emgucv.svn.sourceforge.net/svnroot/emgucv/trunk@52 d7f09016-e345-0410-b530-edf29a71df78
UWP10
canming 17 years ago
parent
commit
744496f4fc
  1. 18
      Emgu.CV.Test/AutoTestImage.cs
  2. 10
      Emgu.CV.Test/AutoTestMatrix.cs
  3. 23
      Emgu.CV.Test/AutoTestVarious.cs

18
Emgu.CV.Test/AutoTestImage.cs

@ -187,11 +187,9 @@ namespace Emgu.CV.Test
[Test]
public void Test_Memory()
{
for (int i = 0; i <= 100; i++)
for (int i = 0; i <= 1000; i++)
{
using (Image<Bgr, Single> img = new Image<Bgr, Single>(500, 500, new Bgr()))
{
}
Image<Bgr, Single> img = new Image<Bgr, Single>(1000, 1000, new Bgr());
}
}
@ -283,18 +281,14 @@ namespace Emgu.CV.Test
{
for (int i = 0; i < 20; i++)
{
using (Image<Gray, Byte> img = new Image<Gray, Byte>(500, 500, new Gray()))
{
Assert.AreEqual(0, System.Convert.ToInt32(img.Sum.Intensity));
}
Image<Gray, Byte> img = new Image<Gray, Byte>(500, 500, new Gray());
Assert.AreEqual(0, System.Convert.ToInt32(img.Sum.Intensity));
}
for (int i = 0; i < 20; i++)
{
using (Image<Bgr, Single> img = new Image<Bgr, Single>(500, 500, new Bgr()))
{
Assert.IsTrue(img.Sum.Equals(new Bgr(0.0, 0.0, 0.0)));
}
Image<Bgr, Single> img = new Image<Bgr, Single>(500, 500, new Bgr());
Assert.IsTrue(img.Sum.Equals(new Bgr(0.0, 0.0, 0.0)));
}
}

10
Emgu.CV.Test/AutoTestMatrix.cs

@ -10,6 +10,7 @@ using System.Windows.Forms;
using System.Xml;
using System.IO;
using System.Runtime.Serialization;
using System.Threading;
namespace Emgu.CV.Test
{
@ -106,17 +107,18 @@ namespace Emgu.CV.Test
public void Test_StressTestMatrixGC()
{
int i = 0;
try
//try
{
for (i = 0; i < 1000; i++)
for (i = 0; i < 2000; i++)
{
Matrix<Single> mat = new Matrix<float>(1000, 1000);
Thread.Sleep(1);
}
}
catch (Exception)
//catch (Exception)
{
}
finally
//finally
{
//Trace.WriteLine(i);
}

23
Emgu.CV.Test/AutoTestVarious.cs

@ -138,18 +138,21 @@ namespace Emgu.CV.Test
[Test]
public void TestException()
{
bool exceptionCaught = false;
Matrix<Byte> mat = new Matrix<byte>(20, 30);
try
for (int i = 0; i < 10; i++)
{
double det = mat.Det;
}
catch (System.Exception)
{
exceptionCaught = true;
bool exceptionCaught = false;
Matrix<Byte> mat = new Matrix<byte>(20, 30);
try
{
double det = mat.Det;
}
catch (CvException excpt)
{
Assert.AreEqual(-201, excpt.Status);
exceptionCaught = true;
}
Assert.IsTrue(exceptionCaught);
}
Assert.IsTrue(exceptionCaught);
}
}
}
Loading…
Cancel
Save