Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -59,7 +59,6 @@ namespace MonoTests.System.Drawing.Design {
{
return GetType (host, an, tn, r);
}
#if NET_2_0
public object Filter (string propertyName, object value)
{
return FilterPropertyValue (propertyName, value);
@@ -74,7 +73,6 @@ namespace MonoTests.System.Drawing.Design {
{
return ValidatePropertyValue (propertyName, value);
}
#endif
}
[TestFixtureSetUp]
@@ -96,7 +94,6 @@ namespace MonoTests.System.Drawing.Design {
Assert.AreEqual (typeof (ToolboxItemFilterAttribute[]), item.Filter.GetType (), "Filter/Type");
Assert.AreEqual (0, item.Filter.Count, "Filter");
Assert.AreEqual (String.Empty, item.TypeName, "TypeName");
#if NET_2_0
Assert.IsNull (item.Company, "Company");
Assert.AreEqual (".NET Component", item.ComponentType, "ComponentType");
Assert.IsNull (item.DependentAssemblies, "DependentAssemblies");
@@ -104,7 +101,6 @@ namespace MonoTests.System.Drawing.Design {
Assert.IsFalse (item.IsTransient, "IsTransient");
Assert.AreEqual (0, item.Properties.Count, "Properties");
Assert.AreEqual (String.Empty, item.Version, "Version");
#endif
}
[Test]
@@ -121,7 +117,6 @@ namespace MonoTests.System.Drawing.Design {
Assert.AreEqual (0, item.Filter.Count, "Filter");
item.TypeName = null;
Assert.AreEqual (String.Empty, item.TypeName, "TypeName");
#if NET_2_0
item.Company = null;
Assert.AreEqual (String.Empty, item.Company, "Company");
// can't assign null without a NRE
@@ -134,7 +129,6 @@ namespace MonoTests.System.Drawing.Design {
Assert.AreEqual (9, item.Properties.Count, "Properties");
item.Lock ();
Assert.AreEqual (9, item.Properties.Count, "Properties/Lock");
#endif
}
[Test]
@@ -214,7 +208,6 @@ namespace MonoTests.System.Drawing.Design {
item.Lock ();
}
#if NET_2_0
[Test]
public void TestNewProperties ()
{
@@ -445,6 +438,5 @@ namespace MonoTests.System.Drawing.Design {
// only documented case
new OurToolboxItem ()._ValidatePropertyValue ("IsTransient", new object ());
}
#endif
}
}

View File

@@ -60,9 +60,7 @@ namespace MonoTests.System.Drawing.Design {
Assert.IsFalse (editor.GetPaintValueSupported (), "GetPaintValueSupported()");
Assert.IsFalse (editor.GetPaintValueSupported (null), "GetPaintValueSupported(null)");
#if NET_2_0
Assert.IsFalse (editor.IsDropDownResizable, "IsDropDownResizable");
#endif
}
[Test]

View File

@@ -1 +1 @@
e8232565933069b1ed8408c17cd52091a0462042
1d44f318763de5d215b9aaed666c3b779e3f5df9

View File

@@ -1 +1 @@
e6c3aacdee5f38f5a69299ed3eaac1de3530a776
d8da270c896e548f1c3833281d02759fa8280aa5

View File

@@ -49,10 +49,8 @@ namespace MonoTests.System.Drawing.Printing {
Assert.AreEqual ("[Margins Left=100 Right=100 Top=100 Bottom=100]", m.ToString (), "ToString");
Margins clone = (Margins) m.Clone ();
Assert.AreEqual (m, clone, "clone");
#if NET_2_0
Assert.IsTrue (m == clone, "==");
Assert.IsFalse (m != clone, "!=");
#endif
}
[Test]
@@ -68,10 +66,8 @@ namespace MonoTests.System.Drawing.Printing {
// bottom smaller than top
Margins m3 = new Margins (10, 20, Int32.MaxValue, 0);
Assert.IsFalse (m2.GetHashCode () == m3.GetHashCode (), "GetHashCode");
#if NET_2_0
Assert.IsTrue (m1 != m2, "m1 != m2");
Assert.IsFalse (m1 == m2, "m1 == m2");
#endif
}
[Test]
@@ -115,10 +111,8 @@ namespace MonoTests.System.Drawing.Printing {
{
Margins m1 = null;
Margins m2 = null;
#if NET_2_0
Assert.IsTrue (m1 == m2, "null==null");
Assert.IsFalse (m1 != m2, "null!=null");
#endif
}
}
}

View File

@@ -34,7 +34,6 @@ namespace MonoTests.System.Drawing.Printing
[TestFixture]
public class PaperSourceTest
{
#if NET_2_0
[Test]
public void KindTest ()
{
@@ -91,7 +90,6 @@ namespace MonoTests.System.Drawing.Printing
Assert.AreEqual ((PaperSourceKind)(int.MinValue), ps.Kind, "Kind #7");
Assert.AreEqual (int.MinValue, ps.RawKind, "RawKind #7");
}
#endif
}

View File

@@ -34,7 +34,6 @@ namespace MonoTests.System.Drawing.Printing
[TestFixture]
public class PaperSizeTest
{
#if NET_2_0
[Test]
public void PaperSizeKindTest()
{
@@ -131,7 +130,6 @@ namespace MonoTests.System.Drawing.Printing
Assert.Fail ("should not have thrown #1b");
}
}
#endif
}
}

View File

@@ -374,9 +374,6 @@ namespace MonoTests.System.Drawing.Printing {
}
[Test]
#if !NET_2_0
[ExpectedException (typeof (ArgumentException))]
#endif
public void FromXml_WrongClass ()
{
PrintingPermission pp = new PrintingPermission (PermissionState.None);
@@ -416,9 +413,6 @@ namespace MonoTests.System.Drawing.Printing {
}
[Test]
#if !NET_2_0
[ExpectedException (typeof (ArgumentException))]
#endif
public void FromXml_NoVersion ()
{
PrintingPermission pp = new PrintingPermission (PermissionState.None);
@@ -463,7 +457,6 @@ namespace MonoTests.System.Drawing.Printing {
Unification (String.Format (PermissionPattern, fx20version));
}
#if NET_2_0
[Test]
[Category ("NotWorking")]
[ExpectedException (typeof (FileLoadException))]
@@ -471,12 +464,5 @@ namespace MonoTests.System.Drawing.Printing {
{
Type.GetType (String.Format (PermissionPattern, "9.99.999.9999"));
}
#else
[Test]
public void Unification_FromFx99 ()
{
Unification (String.Format (PermissionPattern, "9.99.999.9999"));
}
#endif
}
}

View File

@@ -418,13 +418,8 @@ namespace MonoTests.System.Drawing {
[Test]
public void GetStandardValues () {
#if NET_2_0
Assert.AreEqual ((int)KnownColor.MenuHighlight, colconv.GetStandardValues ().Count);
Assert.AreEqual ((int)KnownColor.MenuHighlight, colconv.GetStandardValues (null).Count);
#else
Assert.AreEqual ((int)KnownColor.YellowGreen, colconv.GetStandardValues ().Count);
Assert.AreEqual ((int)KnownColor.YellowGreen, colconv.GetStandardValues (null).Count);
#endif
}
[Test]

View File

@@ -76,10 +76,8 @@ namespace MonoTests.System.Drawing {
private void CheckMono (FontFamily ff)
{
Assert.IsTrue (ff.Equals (FontFamily.GenericMonospace), "GenericMonospace");
#if NET_2_0
// note: Mono has this behaviour on both 1.1 and 2.0 profiles
Assert.AreEqual (ff.Name.GetHashCode (), ff.GetHashCode (), "GetHashCode");
#endif
}
[Test]
@@ -130,10 +128,8 @@ namespace MonoTests.System.Drawing {
{
FontFamily ff = new FontFamily (GenericFontFamilies.SansSerif);
Assert.IsTrue (ff.Equals (FontFamily.GenericSansSerif), "GenericSansSerif");
#if NET_2_0
// note: Mono has this behaviour on both 1.1 and 2.0 profiles
Assert.AreEqual (ff.Name.GetHashCode (), ff.GetHashCode (), "GetHashCode");
#endif
}
[Test]
@@ -141,10 +137,8 @@ namespace MonoTests.System.Drawing {
{
FontFamily ff = new FontFamily (GenericFontFamilies.Serif);
Assert.IsTrue (ff.Equals (FontFamily.GenericSerif), "GenericSerif");
#if NET_2_0
// note: Mono has this behaviour on both 1.1 and 2.0 profiles
Assert.AreEqual (ff.Name.GetHashCode (), ff.GetHashCode (), "GetHashCode");
#endif
}
[Test]

View File

@@ -235,11 +235,7 @@ namespace MonoTests.System.Drawing {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentNullException))]
#else
[ExpectedException (typeof (NullReferenceException))]
#endif
public void Brush_Null ()
{
default_pen.Brush = null;

View File

@@ -76,7 +76,6 @@ namespace MonoCasTests.System.Drawing {
{
Region.FromHrgn (IntPtr.Zero);
}
#if NET_2_0
[Test]
[SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
[ExpectedException (typeof (SecurityException))]
@@ -92,6 +91,5 @@ namespace MonoCasTests.System.Drawing {
{
new Region ().ReleaseHrgn (IntPtr.Zero);
}
#endif
}
}

View File

@@ -27,7 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Drawing;
@@ -150,4 +149,3 @@ namespace MonoTests.System.Drawing {
}
}
#endif

View File

@@ -136,7 +136,6 @@ namespace MonoTests.System.Drawing {
{
using (Bitmap bmp = new Bitmap (100, 100, PixelFormat.Format32bppRgb)) {
Rectangle rect = new Rectangle (0, 0, bmp.Width, bmp.Height);
#if NET_2_0
BitmapData bd = new BitmapData ();
try {
bmp.LockBits (rect, ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed, bd);
@@ -146,9 +145,6 @@ namespace MonoTests.System.Drawing {
Assert.AreEqual (IntPtr.Zero, bd.Scan0, "Scan0");
throw;
}
#else
bmp.LockBits (rect, ImageLockMode.ReadWrite, PixelFormat.Format8bppIndexed);
#endif
}
}
@@ -233,7 +229,6 @@ namespace MonoTests.System.Drawing {
bmp.UnlockBits (null);
}
}
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
public void LockBits_BitmapData_Null ()
@@ -303,14 +298,9 @@ namespace MonoTests.System.Drawing {
bmp.UnlockBits (data);
}
}
#endif
[Test]
#if NET_2_0
[ExpectedException (typeof (InvalidOperationException))]
#else
[ExpectedException (typeof (Exception))]
#endif
public void Format1bppIndexed ()
{
using (Bitmap bmp = new Bitmap (1, 1, PixelFormat.Format1bppIndexed)) {
@@ -321,11 +311,7 @@ namespace MonoTests.System.Drawing {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (InvalidOperationException))]
#else
[ExpectedException (typeof (Exception))]
#endif
public void Format4bppIndexed ()
{
using (Bitmap bmp = new Bitmap (1, 1, PixelFormat.Format4bppIndexed)) {
@@ -336,11 +322,7 @@ namespace MonoTests.System.Drawing {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (InvalidOperationException))]
#else
[ExpectedException (typeof (Exception))]
#endif
public void Format8bppIndexed ()
{
using (Bitmap bmp = new Bitmap (1, 1, PixelFormat.Format8bppIndexed)) {
@@ -1196,11 +1178,7 @@ namespace MonoTests.System.Drawing {
}
[Test]
#if NET_2_0
[Category ("NotWorking")] // http://bugzilla.ximian.com/show_bug.cgi?id=80558
#else
[ExpectedException (typeof (InvalidOperationException))]
#endif
public void XmlSerialize ()
{
new XmlSerializer (typeof (Bitmap));
@@ -1529,9 +1507,6 @@ namespace MonoTests.System.Drawing {
}
[Test]
#if !NET_2_0
[ExpectedException (typeof (InvalidOperationException))]
#endif
public void XmlSerialization ()
{
new XmlSerializer (typeof (Bitmap));

View File

@@ -1315,7 +1315,6 @@ namespace MonoTests.System.Drawing {
Compare (KnownColor.Window, GetSysColorIndex.COLOR_WINDOW);
Compare (KnownColor.WindowFrame, GetSysColorIndex.COLOR_WINDOWFRAME);
Compare (KnownColor.WindowText, GetSysColorIndex.COLOR_WINDOWTEXT);
#if NET_2_0
Compare (KnownColor.ButtonFace, GetSysColorIndex.COLOR_BTNFACE);
Compare (KnownColor.ButtonHighlight, GetSysColorIndex.COLOR_BTNHIGHLIGHT);
Compare (KnownColor.ButtonShadow, GetSysColorIndex.COLOR_BTNSHADOW);
@@ -1323,7 +1322,6 @@ namespace MonoTests.System.Drawing {
Compare (KnownColor.GradientInactiveCaption, GetSysColorIndex.COLOR_GRADIENTINACTIVECAPTION);
Compare (KnownColor.MenuBar, GetSysColorIndex.COLOR_MENUBAR);
Compare (KnownColor.MenuHighlight, GetSysColorIndex.COLOR_MENUHIGHLIGHT);
#endif
}
}
}

View File

@@ -188,20 +188,13 @@ namespace MonoTests.System.Drawing{
[Test]
[SecurityPermission (SecurityAction.Assert, UnmanagedCode = true)]
#if NET_2_0
[ExpectedException (typeof (AccessViolationException))]
#else
[ExpectedException (typeof (NullReferenceException))]
#endif
public void ToLogFont_Null ()
{
Font f = new Font ("Arial", 10);
f.ToLogFont (null);
}
[Test]
#if ONLY_1_1
[ExpectedException (typeof (ArgumentNullException))]
#endif
public void Font_StringNull_Float ()
{
string family = null;

View File

@@ -1 +1 @@
aefcbc7a78118a3bc3564300330db0aea6d8bb6f
6f8e3a61406915c6979749fd17fd232663f9df4f

View File

@@ -206,7 +206,6 @@ namespace MonoTests.System.Drawing {
{
new Icon (typeof (Icon), null);
}
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
public void Constructor_StreamNull_Size ()
@@ -227,7 +226,6 @@ namespace MonoTests.System.Drawing {
{
new Icon ((string) null, 32, 32);
}
#endif
[Test]
public void TestProperties ()
@@ -510,7 +508,6 @@ namespace MonoTests.System.Drawing {
}
#if NET_2_0
[Test]
[ExpectedException (typeof (ArgumentException))]
public void ExtractAssociatedIcon_Null ()
@@ -531,7 +528,6 @@ namespace MonoTests.System.Drawing {
{
Icon.ExtractAssociatedIcon ("does-not-exists.png");
}
#endif
private static bool RunningOnUnix {
get {
@@ -544,14 +540,12 @@ namespace MonoTests.System.Drawing {
[TestFixture]
public class IconFullTrustTest {
#if NET_2_0
[Test]
public void ExtractAssociatedIcon ()
{
string filename_dll = Assembly.GetExecutingAssembly ().Location;
Assert.IsNotNull (Icon.ExtractAssociatedIcon (filename_dll), "dll");
}
#endif
[Test]
public void HandleRoundtrip ()

View File

@@ -168,9 +168,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
#if !NET_2_0
[Category ("NotDotNet")] // MS 1.x throws an ArgumentNullException in this case
#endif
public void Stream_Unlocked ()
{
try {
@@ -195,9 +192,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
#if !NET_2_0
[Category ("NotDotNet")] // MS 1.x throws an ArgumentNullException in this case
#endif
public void Stream_Locked ()
{
Image img = null;
@@ -213,11 +207,7 @@ namespace MonoTests.System.Drawing{
}
[Test]
#if NET_2_0
[Category ("NotWorking")] // http://bugzilla.ximian.com/show_bug.cgi?id=80558
#else
[ExpectedException (typeof (InvalidOperationException))]
#endif
public void XmlSerialize ()
{
new XmlSerializer (typeof (Image));
@@ -230,9 +220,7 @@ namespace MonoTests.System.Drawing{
// as Image
Assert.AreEqual (327683, img.Flags, "Flags");
Assert.IsTrue (img.RawFormat.Equals (ImageFormat.Wmf), "Wmf");
#if NET_2_0
Assert.IsNull (img.Tag, "Tag");
#endif
}
[Test]
@@ -274,9 +262,7 @@ namespace MonoTests.System.Drawing{
// as Image
Assert.AreEqual (327683, img.Flags, "Flags");
Assert.IsTrue (img.RawFormat.Equals (ImageFormat.Emf), "Emf");
#if NET_2_0
Assert.IsNull (img.Tag, "Tag");
#endif
}
[Test]
@@ -383,9 +369,6 @@ namespace MonoTests.System.Drawing{
}
[Test]
#if !NET_2_0
[ExpectedException (typeof (InvalidOperationException))]
#endif
public void XmlSerialization ()
{
new XmlSerializer (typeof (Image));

View File

@@ -399,11 +399,7 @@ namespace MonoTests.System.Drawing
[Test]
public void TestGetProperties ()
{
#if NET_2_0
int basecount = 1;
#else
int basecount = 0;
#endif
PropertyDescriptorCollection propsColl;
propsColl = imgConv.GetProperties (null, image, null);

Some files were not shown because too many files have changed in this diff Show More