Author: toshok
Date: 2006-10-31 18:56:13 -0500 (Tue, 31 Oct 2006)
New Revision: 67198
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Resources/CompatTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Resources/CultureTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/BindingContextTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/BindingTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlEventTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ImageListTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/LabelPropertyTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ProgressBarTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/StatusBarTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolBarTest.cs
Log:
enable a whole bunch more tests, all of which pass on windows (some of which
fail on mono). Fix the Control Invoke test (needs to be running an additional
thread), and fix the paths in the System.Resources tests
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Resources/CompatTest.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Resources/CompatTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Resources/CompatTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -38,23 +38,23 @@
Assert.AreEqual (16, ((byte[])
h["ByteArray2"])[1], fileName + "#8");
Assert.AreEqual (1013, ((int[])
h["IntArray"])[1], fileName + "#9");
Assert.AreEqual ("world", ((string[])
h["StringArray"])[1], fileName + "#10");
- Assert.IsNull (h["InvalidMimeType"]);
- Assert.IsNotNull (h["Image"], fileName +
"#11");
- Assert.AreEqual (typeof (Bitmap),
h["Image"].GetType (), fileName + "#12");
+ Assert.IsNotNull (h["InvalidMimeType"], "#11");
+ Assert.IsNotNull (h["Image"], fileName +
"#12");
+ Assert.AreEqual (typeof (Bitmap),
h["Image"].GetType (), fileName + "#13");
}
}
[Test]
public void TestReader ()
{
- Helper.TestReader
("Test/System.Resources/compat_1_1.resx");
+ Helper.TestReader (Path.Combine (Path.Combine ("Test",
"System.Resources"), "compat_1_1.resx"));
}
#if NET_2_0
[Test]
public void TestReader_2_0 ()
{
- Helper.TestReader
("Test/System.Resources/compat_2_0.resx");
+ Helper.TestReader (Path.Combine (Path.Combine ("Test",
"System.Resources"), "compat_2_0.resx"));
}
#endif
}
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Resources/CultureTest.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Resources/CultureTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Resources/CultureTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -22,7 +22,7 @@
string fileName = Path.GetTempFileName ();
[Test]
- public void TestWriter ()
+ public void Test ()
{
Thread.CurrentThread.CurrentCulture =
Thread.CurrentThread.CurrentUICulture = new
CultureInfo ("de-DE");
@@ -31,14 +31,7 @@
w.AddResource ("point", new Point (42, 43));
w.Generate ();
w.Close ();
- }
- [Test]
- public void TestReader ()
- {
- Thread.CurrentThread.CurrentCulture =
- Thread.CurrentThread.CurrentUICulture =
CultureInfo.InvariantCulture;
-
int count = 0;
ResXResourceReader r = new ResXResourceReader
(fileName);
IDictionaryEnumerator e = r.GetEnumerator ();
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/BindingContextTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/BindingContextTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/BindingContextTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -82,13 +82,11 @@
[SetUp]
protected virtual void SetUp ()
{
- Console.WriteLine ("SETTING UP");
}
[TearDown]
protected virtual void TearDown ()
{
- Console.WriteLine ("TEARING DOWN");
}
[Test]
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/BindingTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/BindingTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/BindingTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -38,13 +38,11 @@
[SetUp]
protected virtual void SetUp ()
{
- Console.WriteLine ("SETTING UP");
}
[TearDown]
protected virtual void TearDown ()
{
- Console.WriteLine ("TEARING DOWN");
}
[Test]
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlEventTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlEventTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlEventTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -8,7 +8,6 @@
namespace MonoTests.System.Windows.Forms
{
[TestFixture]
- [Ignore ("This test has to be completly reviewed")]
public class EventClass
{
static bool eventhandled = false;
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -119,15 +119,11 @@
// P
Assert.AreEqual(null, c.Parent, "P1");
- name = c.ProductName;
- if (!name.Equals("Novell Mono MWF") &&
!name.Equals("Microsoft (R) .NET Framework"))
- Assert.Fail("ProductName property does not
match any accepted value - P2");
+ Assert.IsNotNull(c.ProductName, "P2");
+ Assert.IsTrue(c.ProductName != "", "P3");
+ Assert.IsNotNull(c.ProductVersion, "P4");
+ Assert.IsTrue(c.ProductVersion != "", "P5");
- name = c.ProductVersion;
- if (!name.Equals("1.1.4322.2032")) {
- Assert.Fail("This test is being run against the
wrong framework version.\nExpected is Net 1.1sp1. - P3");
- }
-
// R
Assert.AreEqual(false, c.RecreatingHandle, "R1");
Assert.AreEqual(null, c.Region, "R2");
@@ -582,6 +578,10 @@
bool delegateCalled = false;
public delegate void TestDelegate ();
+ public void delegate_call () {
+ delegateCalled = true;
+ }
+
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void InvokeException1 () {
@@ -593,29 +593,6 @@
}
[Test]
- [Ignore("Seems to hang")]
- public void InvokeTest () {
- Control c = null;
-
- try {
- c = new Control ();
- IAsyncResult result;
-
- c.CreateControl ();
- result = c.BeginInvoke (new TestDelegate
(delegate_call));
- c.EndInvoke (result);
- Assert.AreEqual (true, delegateCalled,
"Invoke1");
- } finally {
- if (c != null)
- c.Dispose ();
- }
- }
-
- public void delegate_call () {
- delegateCalled = true;
- }
-
- [Test]
public void FindFormTest () {
Form f = new Form ();
@@ -887,4 +864,69 @@
Assert.AreEqual(3, EnabledCalledCount, "Child Enabled
Event not properly fired");
}
}
+
+ [TestFixture]
+ public class ControlInvokeTest {
+ public delegate void TestDelegate ();
+
+ Form f;
+ Control c;
+ Thread control_t;
+ ApplicationContext control_context;
+ bool delegateCalled = false;
+
+ object m;
+
+ void CreateControl ()
+ {
+ f = new Form ();
+
+ c = new Control ();
+
+ f.Controls.Add (c);
+
+ Console.WriteLine ("f.Handle = {0}", f.Handle);
+ Console.WriteLine ("c.Handle = {0}", c.Handle);
+
+ control_context = new ApplicationContext (f);
+
+ Monitor.Enter (m);
+ Console.WriteLine ("pulsing");
+ Monitor.Pulse (m);
+ Monitor.Exit (m);
+ Console.WriteLine ("control thread running");
+ Application.Run (control_context);
+ c.Dispose ();
+ }
+
+ [Test]
+ public void InvokeTest ()
+ {
+ m = new object ();
+
+ control_t = new Thread(CreateControl);
+
+ Monitor.Enter (m);
+
+ control_t.Start ();
+
+ Console.WriteLine ("waiting on monitor");
+ Monitor.Wait (m);
+
+ Console.WriteLine ("making async call");
+
+ IAsyncResult result;
+ result = c.BeginInvoke (new TestDelegate
(delegate_call));
+ c.EndInvoke (result);
+
+ Assert.AreEqual (true, delegateCalled, "Invoke1");
+ }
+
+ public void delegate_call () {
+ /* invoked on control_context's thread */
+ delegateCalled = true;
+ f.Dispose ();
+ Application.Exit ();
+ }
+ }
}
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ImageListTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ImageListTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ImageListTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -19,7 +19,6 @@
{
[TestFixture]
- [Ignore ("This test has to be completly reviewed")]
public class ImageListTest
{
[Test]
@@ -59,7 +58,6 @@
}
[TestFixture]
- [Ignore ("This test has to be completly reviewed")]
public class ImageListRecreateHandleEventClass
{
static bool eventhandled = false;
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/LabelPropertyTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/LabelPropertyTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/LabelPropertyTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -19,7 +19,6 @@
namespace MonoTests.System.Windows.Forms
{
[TestFixture]
- [Ignore ("This test has to be completly reviewed")]
public class LabelTest {
[Test]
@@ -47,7 +46,6 @@
Assert.AreEqual (new Rectangle (0,0,100,23),
l.ClientRectangle, "#16");
Assert.AreEqual (23, l.ClientSize.Height, "#17a");
Assert.AreEqual (100, l.ClientSize.Width, "#17b");
- Assert.AreEqual ("Mono Project, Novell, Inc.",
l.CompanyName, "#18");
Assert.AreEqual (null, l.Container, "#19");
Assert.AreEqual (false, l.ContainsFocus, "#20");
Assert.AreEqual (null, l.ContextMenu, "#21");
@@ -88,8 +86,6 @@
Assert.AreEqual (null, l.Parent, "#49");
Assert.AreEqual (16, l.PreferredHeight, "#50");
Assert.AreEqual (0, l.PreferredWidth, "#51");
- Assert.AreEqual ("Novell Mono MWF", l.ProductName,
"#52");
- Assert.AreEqual ("1.1.4322.2032", l.ProductVersion,
"#53");
Assert.AreEqual (false, l.RecreatingHandle, "#54");
Assert.AreEqual (null, l.Region, "#55");
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ProgressBarTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ProgressBarTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ProgressBarTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -16,7 +16,6 @@
namespace MonoTests.System.Windows.Forms
{
[TestFixture]
- [Ignore ("This test has to be completly reviewed")]
public class ProgressBarBaseTest
{
[Test]
@@ -29,8 +28,6 @@
// B
Assert.AreEqual ("Control",
myProgressBar.BackColor.Name, "#B1");
- myProgressBar.BackColor = Color.White;
- Assert.AreEqual (255, myProgressBar.BackColor.R, "#B2");
Assert.AreEqual (null, myProgressBar.BackgroundImage,
"#B3");
string gif = "M.gif";
myProgressBar.BackgroundImage = Image.FromFile (gif);
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/StatusBarTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/StatusBarTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/StatusBarTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -16,7 +16,6 @@
namespace MonoTests.System.Windows.Forms
{
[TestFixture]
- [Ignore ("This test has to be completly reviewed")]
public class StatusBarTest
{
@@ -35,10 +34,6 @@
// B
Assert.AreEqual ("Control", mysbar.BackColor.Name,
"#B1");
- mysbar.BackColor = Color.Red;
- Assert.AreEqual (212, mysbar.BackColor.R, "#B2");
- mysbar.BackgroundImage = Image.FromFile ("M.gif");
- Assert.AreEqual (60, mysbar.BackgroundImage.Height,
"#B3");
// D
Assert.AreEqual (DockStyle.Bottom, mysbar.Dock, "#D1");
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolBarTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolBarTest.cs
2006-10-31 23:41:18 UTC (rev 67197)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolBarTest.cs
2006-10-31 23:56:13 UTC (rev 67198)
@@ -20,7 +20,6 @@
{
[Test]
- [Ignore ("This test has to be completly reviewed")]
public void ToolBarPropertyTest ()
{
Form myform = new Form ();
@@ -39,8 +38,6 @@
// B
Assert.AreEqual ("Control", myToolBar.BackColor.Name,
"#B1");
- myToolBar.BackColor = Color.Red;
- Assert.AreEqual (255, myToolBar.BackColor.R, "#B2");
myToolBar.BackgroundImage = Image.FromFile ("M.gif");
Assert.AreEqual (60, myToolBar.BackgroundImage.Height,
"#B3");
Assert.AreEqual (BorderStyle.None,
myToolBar.BorderStyle, "#B4");
@@ -87,7 +84,6 @@
}
[Test]
- [Ignore ("This test has to be completly reviewed")]
public void ToStringMethodTest ()
{
ToolBar myToolBar = new ToolBar ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches