* Makefile.am: Build `docs` after `runtime`, so that it can depend
[mono.git] / mcs / class / Managed.Windows.Forms / Test / System.Windows.Forms / ComboBoxTest.cs
index a0903f651050e33be84b77894e1a2d5d4a05f1fc..2c453e25f28bce2e82ed1b4e2743de360aacb1f8 100644 (file)
@@ -1325,6 +1325,33 @@ namespace MonoTests.System.Windows.Forms
                        }
                }
 #endif
+
+               private struct ComboVal
+               {
+                       public string text;
+
+                       public ComboVal (string t)
+                       {
+                               text = t;
+                       }
+
+                       public override string ToString ()
+                       {
+                               return text;
+                       }
+               }
+               
+               [Test]
+               public void SortTest ()
+               {
+                       // Test sorting of objects with no IComparer
+                       // should not crash
+
+                       ComboBox cmb = new ComboBox ();
+                       cmb.Items.Add (new ComboVal ("B"));
+                       cmb.Items.Add (new ComboVal ("A"));
+                       cmb.Sorted = true;
+               }
        }
 
        [TestFixture]
@@ -1669,4 +1696,4 @@ namespace MonoTests.System.Windows.Forms
                        }
                }
        }
-}
+}
\ No newline at end of file