Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@ -0,0 +1,250 @@
2010-07-15 Sebastien Pouliot <sebastien@ximian.com>
* LinearGradientBrushTest.cs: Add test case for #537396 (empty rects)
2009-08-28 Atsushi Enomoto <atsushi@ximian.com>
* TestBlend.cs, TestMatrix.cs : nunit test upgrade to modern style.
2008-12-23 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs, LinearGradientBrushTest.cs, TestMatrix.cs:
Add delta when comparing floating point values since there can be
small differences between different platforms.
2008-12-10 Atsushi Enomoto <atsushi@ximian.com>
* LinearGradientBrushTest.cs, GraphicsPathTest.cs,
TestMatrix.cs : fix tests wrt rounding that were failing on .NET
too (exposed by nunit24).
2008-11-01 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathIteratorTest.cs: New. Add some (incomplete) unit
tests for GraphicsPathIterator. Test cases are mostly to ensure
null check compatibility with MS.
* LinearGradientBrushTest.cs: Add test case when setting null
on properties.
* PathGradientBrushTest.cs: Add test case when setting null
on properties.
2008-09-03 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Add unit test to check for an open curve
points.
2008-09-02 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Add a bunch of unit tests to check when
points can be compressed (removed) when adding shapes to a path.
2008-08-04 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Add test case for "half" closed paths.
[Bug #413461]
2007-10-30 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added IsVisible test cases on ellipses
(#325502)
2007-07-31 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added more test cases for Reverse based on the
C test cases provided in #81859.
2007-07-30 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added more test cases for Reverse, the complex
ones don't work yet (see #81859).
2007-03-30 Sebastien Pouliot <sebastien@ximian.com>
* TestMatrix.cs: Allow a small delta when comparing floats. This
allows the ARM to work properly (e.g. -9.999995 versus -10).
2006-09-26 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added test case for Reverse (and found out that
the types aren't reversed, only the points are).
2006-09-18 Boris Kirzner <borisk@mainsoft.com>
* TestColorBlend.cs,TestHatchBrush.cs : marked tests not working
for TARGET_JVM.
2006-08-16 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Ignore some test cases if we cannot get any
font family from GDI+.
* TestHatchBrush.cs: Ignore some test cases if we cannot get any font
family from GDI+. Update to NUnit 2.2+ and fix getOutSufix method
2006-06-09 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added test cases for IsVisible methods.
2006-06-07 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added test cases for IsOutlineVisible methods.
2006-06-01 Sebastien Pouliot <sebastien@ximian.com>
* TestHatchBrush.cs: Some were surprisingly similar until...
2006-05-24 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Ignore some test cases that aren't implemented
in libgdiplus and have different results in MS 1.x/2.0 (or between
different executions, yuck).
2006-05-09 Sebastien Pouliot <sebastien@ximian.com>
* PathGradientBrushTest.cs: New. Unit tests (mostly) based on the test
cases created for LinearGradientBrush.
2006-05-08 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added test cases for Widen and Wrap with empty
path (expected behaviour) and paths that have a single point (stranger
behaviour). Changed comments on GetBounds_WithPen test case as it will
probably never work under Mono due to difference in precisions.
2006-05-05 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added more test cases for GetBounds and found
out the results are very imprecise when curves are used (hence
difficult to test but much easier to implement ;-)
2006-05-03 Sebastien Pouliot <sebastien@ximian.com>
* LinearGradientBrushTest.cs: Added new test case for #78185 (from
Bill Holmes).
2006-05-01 Sebastien Pouliot <sebastien@ximian.com>
* LinearGradientBrushTest.cs: Added new test case for #78179 (from
Bill Holmes).
2006-04-28 Sebastien Pouliot <sebastien@ximian.com>
* TestColorBlend.cs: Added new test cases to verify if the TODO were
still valid. Updated existing test cases to nunit 2.2 api.
* GraphicsPathTest.cs: Added new test cases for AddCurve and it's
different behaviour (in some methods) when only two points are used
to define a curve.
2006-04-27 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Activate two unit tests where we use AddLines
to add a single point to a path.
2006-04-27 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added new test cases for AddString.
2006-04-20 Sebastien Pouliot <sebastien@ximian.com>
* LinearGradientBrushTest.cs: Remove "NonWorking" from many test
cases. Added more test cases for non-invertible matrix and to ensure
all matrix-based transformation are correct.
2006-04-19 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Add test cases for Wrap and Widen (most of them
are current "NotWorking").
2006-04-10 Sebastien Pouliot <sebastien@ximian.com>
* TestMatrix.cs: Added new test cases for contructors accepting
rectangles and points.
2006-03-30 Sebastien Pouliot <sebastien@ximian.com>
* LinearGradientBrushTest.cs: Added a bunch of test cases to check
for the "initial" matrix of the brush (which we don't set).
* TestMatrix.cs: Added test cases about matrix identity precision.
2006-03-29 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Add test cases for every Add* method to check
their (different) behaviour wrt starting and closing figures in the
path they are added.
2006-03-28 Sebastien Pouliot <sebastien@ximian.com>
* TestMatrix.cs: Added new test cases.
2006-03-22 Sebastien Pouliot <sebastien@ximian.com>
* LinearGradientBrushTest.cs: New. Some unit tests (moslty failing).
2006-03-14 Sebastien Pouliot <sebastien@ximian.com>
* TestMatrix.cs: Added new test cases to test libgdiplus validations.
2006-03-13 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added new test cases for SetMarkers,
ClearMarkers, CloseFigure and CloseAllFigures on an empty path.
2006-01-27 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Removed "NotWorking" from existing Flatten
tests and added more test cases (for each type of shape).
2006-01-16 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: Added test cases for GetBounds and re-activated
some parts of the tests that checked bounds (Add* tests).
2006-01-13 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: New. Added multiple test cases to check null
handling and how the points are generated for the Add* methods.
* PathDataTest.cs: New. Added clone test case.
2006-01-12 Sebastien Pouliot <sebastien@ximian.com>
* GraphicsPathTest.cs: New. Basic test cases for empty path and
cloning.
* PathDataTest.cs: New. Test cases for PathData.
2005-09-16 Sebastien Pouliot <sebastien@ximian.com>
* TestBlend.cs, TestColorBlend.cs, TestHatchBrush.cs, TestMatrix.cs:
Deny UnmanagedCode permission to all tests. This shows (when executed
under MS runtime) that S.D API is safe and doesn't requires high
privileges to run - even if we know that, deep down, this calls into
GDI+.
2005-08-25 Jordi Mas i Hernandez <jordi@ximian.com>
* TestMatrix.cs: New test cases
2005-08-24 Jordi Mas i Hernandez <jordi@ximian.com>
* TestMatrix.cs: New Matrix unit case
2004-06-03 Ravindra <rkumar@novell.com>
* TestHatchBrush.cs: Added missing test cases for all the hatch
styles.
2004-05-18 Ravindra <rkumar@novell.com>
* TestHatchBrush.cs: Added a test case for HatchBrush.cs.
* TestBlend.cs: dos2unix format and namespace changed to
MonoTests.System.Drawing.Drawing2D.
* TestColorBlend.cs: dos2unix format and namespace changed to
MonoTests.System.Drawing.Drawing2D.
2004-03-17 Ravindra <rkumar@novell.com>
* TestBlend.cs: Added.
* TestColorBlend.cs: Added.
2004-03-17 Ravindra <rkumar@novell.com>
* System.Drawing.Drawing2D: Created a repository for
System.Drawing.Drawing2D tests.
* ChangeLog: Added.

View File

@ -0,0 +1 @@
e8232565933069b1ed8408c17cd52091a0462042

View File

@ -0,0 +1,87 @@
//
// System.Drawing.Drawing2D.PathData unit tests
//
// Authors:
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Security.Permissions;
using NUnit.Framework;
namespace MonoTests.System.Drawing.Drawing2D {
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
public class PathDataTest {
[Test]
public void PathData_Empty ()
{
PathData data = new PathData ();
Assert.IsNull (data.Points, "Points");
Assert.IsNull (data.Types, "Types");
data.Points = new PointF[0];
data.Types = new byte[0];
Assert.AreEqual (0, data.Points.Length, "Points-0");
Assert.AreEqual (0, data.Types.Length, "Types-0");
data.Points = null;
data.Types = null;
Assert.IsNull (data.Points, "Points-1");
Assert.IsNull (data.Types, "Types-1");
}
[Test]
public void PathData_LengthMismatch ()
{
PathData data = new PathData ();
data.Points = new PointF[2];
data.Types = new byte[1];
Assert.AreEqual (2, data.Points.Length, "Points-2");
Assert.AreEqual (1, data.Types.Length, "Types-1");
}
[Test]
public void PathData_UnclonedProperties ()
{
PathData data = new PathData ();
data.Points = new PointF[1] { new PointF (1f, 1f) };
data.Types = new byte[1] { 1 };
Assert.AreEqual (1f, data.Points[0].X, "Points.X");
Assert.AreEqual (1f, data.Points[0].Y, "Points.Y");
Assert.AreEqual (1, data.Types[0], "Types");
data.Points[0] = new PointF (0f, 0f);
Assert.AreEqual (0f, data.Points[0].X, "Points.X.1");
Assert.AreEqual (0f, data.Points[0].Y, "Points.Y.1");
data.Types[0] = 0;
Assert.AreEqual (0, data.Types[0], "Types-1");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,83 @@
//
// Tests for System.Drawing.Drawing2D.Blend.cs
//
// Author:
// Ravindra (rkumar@novell.com)
//
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using NUnit.Framework;
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Security.Permissions;
namespace MonoTests.System.Drawing.Drawing2D
{
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
public class BlendTest
{
[TearDown]
public void TearDown () { }
[SetUp]
public void SetUp () { }
[Test]
public void TestConstructors ()
{
Blend blend0 = new Blend ();
Assert.AreEqual (1, blend0.Factors.Length, "C#1");
Assert.AreEqual (1, blend0.Positions.Length, "C#2");
Blend blend1 = new Blend (1);
Assert.AreEqual (1, blend1.Factors.Length, "C#3");
Assert.AreEqual (1, blend1.Positions.Length, "C#4");
}
[Test]
public void TestProperties ()
{
Blend blend0 = new Blend ();
Assert.AreEqual (0, blend0.Factors[0], "P#1");
Assert.AreEqual (0, blend0.Positions[0], "P#2");
Blend blend1 = new Blend (1);
float[] positions = {0.0F, 0.5F, 1.0F};
float[] factors = {0.0F, 0.5F, 1.0F};
blend1.Factors = factors;
blend1.Positions = positions;
Assert.AreEqual (factors[0], blend1.Factors[0], "P#3");
Assert.AreEqual (factors[1], blend1.Factors[1], "P#4");
Assert.AreEqual (factors[2], blend1.Factors[2], "P#5");
Assert.AreEqual (positions[0], blend1.Positions[0], "P#6");
Assert.AreEqual (positions[1], blend1.Positions[1], "P#7");
Assert.AreEqual (positions[2], blend1.Positions[2], "P#8");
}
}
}

View File

@ -0,0 +1,116 @@
//
// Tests for System.Drawing.Drawing2D.ColorBlend.cs
//
// Authors:
// Ravindra (rkumar@novell.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2004,2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using NUnit.Framework;
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Security.Permissions;
namespace MonoTests.System.Drawing.Drawing2D
{
[TestFixture]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
public class ColorBlendTest {
[Test]
public void TestConstructors ()
{
ColorBlend cb1 = new ColorBlend (1);
Assert.AreEqual (1, cb1.Colors.Length, "Colors");
Assert.AreEqual (1, cb1.Positions.Length, "Positions");
}
[Test]
public void TestProperties ()
{
ColorBlend cb1 = new ColorBlend (1);
float[] positions = {0.0F, 0.5F, 1.0F};
Color[] colors = {Color.Red, Color.White, Color.Black};
cb1.Colors = colors;
cb1.Positions = positions;
// size match
Assert.AreEqual (colors[0], cb1.Colors[0], "c0");
Assert.AreEqual (colors[1], cb1.Colors[1], "c1");
Assert.AreEqual (colors[2], cb1.Colors[2], "c2");
Assert.AreEqual (positions[0], cb1.Positions[0], "p0");
Assert.AreEqual (positions[1], cb1.Positions[1], "p1");
Assert.AreEqual (positions[2], cb1.Positions[2], "p2");
}
[Test]
public void ColorBlend_Empty ()
{
ColorBlend cb = new ColorBlend ();
Assert.AreEqual (1, cb.Colors.Length, "Colors");
Assert.IsTrue (cb.Colors[0].IsEmpty, "C0");
Assert.AreEqual (1, cb.Positions.Length, "Positions");
Assert.AreEqual (0f, cb.Positions[0], "P0");
}
[Test]
public void ColorBlend_Zero ()
{
ColorBlend cb = new ColorBlend (0);
Assert.AreEqual (0, cb.Colors.Length, "Colors");
Assert.AreEqual (0, cb.Positions.Length, "Positions");
}
[Test]
public void MismatchSizes ()
{
ColorBlend cb = new ColorBlend ();
cb.Colors = new Color[16];
Assert.AreEqual (16, cb.Colors.Length, "Colors");
cb.Positions = new float[1];
Assert.AreEqual (1, cb.Positions.Length, "Positions");
}
[Test]
[ExpectedException (typeof (OverflowException))]
#if TARGET_JVM
[Category ("NotWorking")] // defect 6364
#endif
public void ColorBlend_Negative ()
{
ColorBlend cb = new ColorBlend (-1);
}
[Test]
public void ColorBlend_Lots ()
{
ColorBlend cb = new ColorBlend (1000);
Assert.AreEqual (1000, cb.Colors.Length, "Colors");
Assert.AreEqual (1000, cb.Positions.Length, "Positions");
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff