2008-12-02 Jonathan Pobst <monkey@jpobst.com>
authorJonathan Pobst <monkey@jpobst.com>
Tue, 2 Dec 2008 17:30:39 +0000 (17:30 -0000)
committerJonathan Pobst <monkey@jpobst.com>
Tue, 2 Dec 2008 17:30:39 +0000 (17:30 -0000)
* PaintEventArgsTest.cs: Tests were failing due to being dependent
on the order in which the tests were running, which changed when we
did nunit 2.2->2.4.  Modified tests to not use global Graphics contexts,
and to dispose the Graphics like they were relying on the
GraphicsDispose () test to do.

svn path=/trunk/mcs/; revision=120504

mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/PaintEventArgsTest.cs

index 6ca546923ab0d713d6ee8fa3f2701942e34f7e93..ae02b2be8f50c6764dfa9f25618dfdf326d74ab7 100644 (file)
@@ -1,3 +1,11 @@
+2008-12-02  Jonathan Pobst  <monkey@jpobst.com>
+
+       * PaintEventArgsTest.cs: Tests were failing due to being dependent
+       on the order in which the tests were running, which changed when we
+       did nunit 2.2->2.4.  Modified tests to not use global Graphics contexts,
+       and to dispose the Graphics like they were relying on the
+       GraphicsDispose () test to do.
+
 2008-11-24  Jonathan Pobst  <monkey@jpobst.com>
 
        * DataGridViewDataBindingTest.cs: Flush and add test for bug #448005.
index 6c6fbc5889f62b08beb4b27e8fa65673b3aa53e3..ea408644e70e4fc0644bede9870e4a58ba718f5c 100644 (file)
@@ -90,6 +90,10 @@ namespace MonoTests.System.Windows.Forms {
 #endif
                public void IDisposable_IDispose ()
                {
+                       Bitmap bmp = new Bitmap (1, 1);
+                       Graphics default_graphics = Graphics.FromImage (bmp);
+                       Rectangle default_rect = new Rectangle (Int32.MinValue, Int32.MinValue, Int32.MaxValue, Int32.MaxValue);
+
                        PaintEventArgs pea = new PaintEventArgs (default_graphics, default_rect);
                        (pea as IDisposable).Dispose ();
                        // uho, under 2.0 we not really disposing the stuff - it means it's not ours to dispose!
@@ -127,7 +131,12 @@ namespace MonoTests.System.Windows.Forms {
                [ExpectedException (typeof (ArgumentException))]
                public void Dispose_True ()
                {
+                       Bitmap bmp = new Bitmap (1, 1);
+                       Graphics default_graphics = Graphics.FromImage (bmp);
+                       Rectangle default_rect = new Rectangle (Int32.MinValue, Int32.MinValue, Int32.MaxValue, Int32.MaxValue);
+
                        PaintEventArgsTester pea = new PaintEventArgsTester (default_graphics, default_rect);
+                       pea.Graphics.Dispose ();
                        pea.DisposeBool (true);
                        Assert.IsTrue (pea.Graphics.Transform.IsIdentity, "Graphics.Transform");
                }
@@ -140,7 +149,12 @@ namespace MonoTests.System.Windows.Forms {
                [ExpectedException (typeof (ArgumentException))]
                public void Dispose_False ()
                {
+                       Bitmap bmp = new Bitmap (1, 1);
+                       Graphics default_graphics = Graphics.FromImage (bmp);
+                       Rectangle default_rect = new Rectangle (Int32.MinValue, Int32.MinValue, Int32.MaxValue, Int32.MaxValue);
+
                        PaintEventArgsTester pea = new PaintEventArgsTester (default_graphics, default_rect);
+                       pea.Graphics.Dispose ();
                        pea.DisposeBool (false);
                        Assert.IsTrue (pea.Graphics.Transform.IsIdentity, "Graphics.Transform");
                }