Author: spouliot
Date: 2006-10-18 16:51:23 -0400 (Wed, 18 Oct 2006)
New Revision: 66803

Modified:
   trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
   trunk/mcs/class/System.Drawing/Test/System.Drawing/TestGraphics.cs
Log:
2006-10-18  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * TestGraphics.cs: Ignore new test cases when font is null (not 
        available). Add pixel size compares to MeasureString_Bug76664.



Modified: trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog
===================================================================
--- trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog        
2006-10-18 20:39:34 UTC (rev 66802)
+++ trunk/mcs/class/System.Drawing/Test/System.Drawing/ChangeLog        
2006-10-18 20:51:23 UTC (rev 66803)
@@ -1,3 +1,8 @@
+2006-10-18  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * TestGraphics.cs: Ignore new test cases when font is null (not 
+       available). Add pixel size compares to MeasureString_Bug76664.
+
 2006-10-11  Sebastien Pouliot  <[EMAIL PROTECTED]>
 
        * TestGraphics.cs: Added test case to measure strings, some aren't yet

Modified: trunk/mcs/class/System.Drawing/Test/System.Drawing/TestGraphics.cs
===================================================================
--- trunk/mcs/class/System.Drawing/Test/System.Drawing/TestGraphics.cs  
2006-10-18 20:39:34 UTC (rev 66802)
+++ trunk/mcs/class/System.Drawing/Test/System.Drawing/TestGraphics.cs  
2006-10-18 20:51:23 UTC (rev 66803)
@@ -1413,10 +1413,15 @@
                                        SizeF size = g.MeasureString (s, font);
 
                                        int chars, lines;
-                                       size = g.MeasureString (s, font, new 
SizeF (80, size.Height), null, out chars, out lines);
+                                       SizeF size2 = g.MeasureString (s, font, 
new SizeF (80, size.Height), null, out chars, out lines);
+
+                                       // in pixels
+                                       Assert.IsTrue (size2.Width < 
size.Width, "Width/pixel");
+                                       Assert.AreEqual (size2.Height, 
size.Height, "Height/pixel");
+
+                                       Assert.AreEqual (1, lines, "lines 
fitted");
                                        // LAMESPEC: documentation seems to 
suggest chars is total length
                                        Assert.IsTrue (chars < s.Length, 
"characters fitted");
-                                       AssertEquals ("lines fitted", 1, lines);
                                }
                        }
                }
@@ -1442,6 +1447,9 @@
                [Test]
                public void MeasureCharacterRanges_EmptyStringFormat ()
                {
+                       if (font == null)
+                               Assert.Ignore ("Couldn't create required font");
+
                        using (Bitmap bitmap = new Bitmap (20, 20)) {
                                using (Graphics g = Graphics.FromImage 
(bitmap)) {
                                        // string format without character 
ranges
@@ -1568,6 +1576,9 @@
                [ExpectedException (typeof (ArgumentException))]
                public void MeasureCharacterRanges_NullStringFormat ()
                {
+                       if (font == null)
+                               Assert.Ignore ("Couldn't create required font");
+
                        using (Bitmap bitmap = new Bitmap (20, 20)) {
                                using (Graphics g = Graphics.FromImage 
(bitmap)) {
                                        g.MeasureCharacterRanges ("Mono", font, 
new RectangleF (), null);
@@ -1793,6 +1804,9 @@
                [Test]
                public void MeasureString_Wrapping_Dots ()
                {
+                       if (font == null)
+                               Assert.Ignore ("Couldn't create required font");
+
                        string text = "this is really long 
text........................................... with a lot o periods.";
                        using (Bitmap bitmap = new Bitmap (20, 20)) {
                                using (Graphics g = Graphics.FromImage 
(bitmap)) {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to