[Mono-winforms-list] some fixes for tests

Atsushi Eno atsushi at ximian.com
Wed May 17 03:28:35 EDT 2006


Hi,

I tried make run-test-ondotnet and got some failures. I believe
that some are due to environment-dependency (like, some tests
result different depending on desktop themes). On some languages
those tests would work, but they don't on this Japanese box.

It still fails at:

1) MonoTests.System.Resources.CompatTest.TestReader :
System.ArgumentException : Invalid ResX input.
  ----> System.IO.FileNotFoundException : File or assembly name
System.Drawing, or one of its dependencies, was not found.

Atsushi Eno
-------------- next part --------------
Index: Test/System.Windows.Forms/RichTextBoxTest.cs
===================================================================
--- Test/System.Windows.Forms/RichTextBoxTest.cs	(revision 60764)
+++ Test/System.Windows.Forms/RichTextBoxTest.cs	(working copy)
@@ -174,6 +174,7 @@
 		}
 
 		[Test]
+		[Ignore ("this test depends on system default font")]
 		public void GetCharFromPositionTest ()
 		{
 			Form myForm = new Form ();
Index: Test/System.Windows.Forms/ComboBoxTest.cs
===================================================================
--- Test/System.Windows.Forms/ComboBoxTest.cs	(revision 60764)
+++ Test/System.Windows.Forms/ComboBoxTest.cs	(working copy)
@@ -53,7 +53,8 @@
 			//Assert.AreEqual (15, mycmbbox.ItemHeight, "#7"); 	// Note: Item height depends on the current font.
 			Assert.AreEqual (8, mycmbbox.MaxDropDownItems, "#8");
 			Assert.AreEqual (0, mycmbbox.MaxLength, "#9");
-			Assert.AreEqual (20, mycmbbox.PreferredHeight, "#10");
+			//Assert.AreEqual (20, mycmbbox.PreferredHeight, "#10");
+// Note: Item height depends on the current font.
 			Assert.AreEqual (-1, mycmbbox.SelectedIndex, "#11");
 			Assert.AreEqual (null, mycmbbox.SelectedItem, "#12");
 			Assert.AreEqual ("", mycmbbox.SelectedText, "#13");
Index: Test/System.Windows.Forms/ScrollBarTest.cs
===================================================================
--- Test/System.Windows.Forms/ScrollBarTest.cs	(revision 60764)
+++ Test/System.Windows.Forms/ScrollBarTest.cs	(working copy)
@@ -288,7 +288,7 @@
 		       Assert.AreEqual (16, myscrlbar.BackgroundImage.Height, "B3");
 
 		       // F
-		       Assert.AreEqual ("ff000000", myscrlbar.ForeColor.Name, "F1");
+		       Assert.AreEqual ("ControlText", myscrlbar.ForeColor.Name, "F1");
 
 		       // I
 		       //Assert.AreEqual (ImeMode.Disable, myscrlbar.ImeMode, "I1");
@@ -444,6 +444,7 @@
 		       myform.Visible = true;
 		       ScrollBar myHscrlbar = new HScrollBar ();
 		       myform.Controls.Add (myHscrlbar);
+		       myHscrlbar.Font = new Font (FontFamily.GenericMonospace, 10);
 		       myHscrlbar.FontChanged += new EventHandler (ScrollBar_EventHandler);
 		       FontDialog myFontDialog = new FontDialog();
 		       myHscrlbar.Font = myFontDialog.Font;
@@ -601,7 +602,8 @@
 		       MyHScrollBar msbar = new MyHScrollBar ();
 
 		       Assert.AreEqual (80, msbar.MyDefaultSize.Width, "D1");
-		       Assert.AreEqual (21, msbar.MyDefaultSize.Height, "D2");
+			// this is environment dependent.
+		       //Assert.AreEqual (21, msbar.MyDefaultSize.Height, "D2");
 	       }
     }
 
@@ -637,7 +639,8 @@
 	       {
 		       MyVScrollBar msbar = new MyVScrollBar ();
 
-		       Assert.AreEqual (21, msbar.MyDefaultSize.Width, "D3");
+			// This is environment dependent.
+		       //Assert.AreEqual (21, msbar.MyDefaultSize.Width, "D3");
 		       Assert.AreEqual (80, msbar.MyDefaultSize.Height, "D4");
 	       }
     }
Index: Test/System.Windows.Forms/ListBoxTest.cs
===================================================================
--- Test/System.Windows.Forms/ListBoxTest.cs	(revision 60764)
+++ Test/System.Windows.Forms/ListBoxTest.cs	(working copy)
@@ -250,13 +250,13 @@
 			listBox.SelectionMode = (SelectionMode) 10;
 		}
 
-		[Test][ExpectedException(typeof(InvalidOperationException))]
+		[Test]
 		public void SelectedValueNull()
 		{
 			listBox.SelectedValue = null;
 		}
 
-		[Test][ExpectedException(typeof(InvalidOperationException))]
+		[Test]
 		public void SelectedValueEmptyString()
 		{
 			listBox.SelectedValue = String.Empty;
Index: Test/System.Windows.Forms/ComboBoxTests.cs
===================================================================
--- Test/System.Windows.Forms/ComboBoxTests.cs	(revision 60764)
+++ Test/System.Windows.Forms/ComboBoxTests.cs	(working copy)
@@ -66,7 +66,8 @@
 		Assert.AreEqual(-1, comboBox.SelectedIndex);
 		Assert.IsNull(comboBox.SelectedItem);
 		Assert.AreEqual(121, comboBox.Size.Width);
-		Assert.AreEqual(20, comboBox.Size.Height);
+		//Note: it is environment dependent
+		//Assert.AreEqual(20, comboBox.Size.Height);
 		Assert.IsFalse(textChanged);
 		Assert.IsFalse(layoutUpdated);
 	}
Index: Test/System.Windows.Forms/TabControlTest.cs
===================================================================
--- Test/System.Windows.Forms/TabControlTest.cs	(revision 60764)
+++ Test/System.Windows.Forms/TabControlTest.cs	(working copy)
@@ -40,7 +40,8 @@
 		
 		// I 
 		Assert.AreEqual (null, myTabControl.ImageList, "#I1");
-		Assert.AreEqual (18, myTabControl.ItemSize.Height, "#I2");
+		// It is environment dependent
+		//Assert.AreEqual (18, myTabControl.ItemSize.Height, "#I2");
 		Assert.AreEqual (0, myTabControl.ItemSize.Width, "#I3");
 
 		// M 
@@ -76,7 +77,8 @@
 		Assert.AreEqual (2, myTabRect.X, "#GetT1");
 		Assert.AreEqual (2, myTabRect.Y, "#GetT2");
 		Assert.AreEqual (42, myTabRect.Width, "#GetT3");
-		Assert.AreEqual (18, myTabRect.Height, "#GetT4");
+		// It is environment dependent
+		//Assert.AreEqual (18, myTabRect.Height, "#GetT4");
 	}
 
 	[Test]
@@ -125,6 +127,9 @@
 		c.TabPages.Add (new TabPage ());
 		c.TabPages.Add (new TabPage ());
 		Assert.AreEqual (0, c.SelectedIndex, "#1");
+		Form f = new Form ();
+		f.Controls.Add (c);
+		f.Show ();
 		c.SelectedIndex = 2; // beyond the pages - ignored
 		Assert.AreEqual (0, c.SelectedIndex, "#2");
 	}


More information about the Mono-winforms-list mailing list