Author: rolf
Date: 2006-11-22 15:23:31 -0500 (Wed, 22 Nov 2006)
New Revision: 68371
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
Log:
2006-11-20 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* ControlTest.cs: Added tests for #79999.
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2006-11-22 20:21:45 UTC (rev 68370)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2006-11-22 20:23:31 UTC (rev 68371)
@@ -1,5 +1,9 @@
2006-11-20 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+ * ControlTest.cs: Added tests for #79999.
+
+2006-11-20 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+
* MdiFormTest.cs: Added tests for WindowState (mdi
children) and Text (mdi parent with maximized mdi
children).
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-11-22 20:21:45 UTC (rev 68370)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
2006-11-22 20:23:31 UTC (rev 68371)
@@ -168,6 +168,45 @@
}
[Test]
+ public void SizeChangeTest ()
+ {
+ Form f = new Form ();
+ Control c = new Control ();
+ f.Controls.Add(c);
+ f.Show();
+ c.Resize += new
EventHandler(SizeChangedTest_ResizeHandler);
+ c.Tag = true;
+ c.Size = c.Size;
+ Assert.AreEqual (true, (bool) c.Tag, "#1");
+ f.Close ();
+ }
+
+ private void SizeChangedTest_ResizeHandler (object sender,
EventArgs e)
+ {
+ Console.WriteLine("Resized");
+ ((Control) sender).Tag = false;
+ }
+
+ [Test]
+ public void NegativeHeightTest ()
+ {
+ Control c = new Control ();
+ IntPtr handle = c.Handle;
+ c.Resize += new
EventHandler(NegativeHeightTest_ResizeHandler);
+ c.Tag = -2;
+ c.Height = 2;
+ c.Height = -2;
+ Assert.AreEqual (0, (int) c.Tag, "#1");
+ c.Dispose ();
+ }
+
+ private void NegativeHeightTest_ResizeHandler (object sender,
EventArgs e)
+ {
+ Control c = (Control) sender;
+ c.Tag = c.Height;
+ }
+
+ [Test]
public void TopLevelControlTest () {
Control c = new Control ();
@@ -937,5 +976,6 @@
f.Dispose ();
Application.Exit ();
}
+
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches