2009-06-10 Gert Driesen <drieseng@users.sourceforge.net>
authorMiguel de Icaza <miguel@gnome.org>
Thu, 25 Jun 2009 23:19:41 +0000 (23:19 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Thu, 25 Jun 2009 23:19:41 +0000 (23:19 -0000)
* corlib_test.dll.sources: Added test for InternalVisibleToAttribute.

2009-06-10  Marek Safar  <marek.safar@gmail.com>

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

mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/Int32.cs
mcs/class/corlib/Test/System/Int32Test.cs

index c80761a9f2cdcb9b275f511b48f5c02c7fe1ae94..93e475390a4a0f441010c23fee068cf7e6509b5c 100644 (file)
@@ -1,3 +1,10 @@
+2009-06-25  Miguel de Icaza  <miguel@novell.com>
+
+       * Int32.cs: Validate the NumberStyles, passes Int/Int32Parse2.exe
+
+       Fix regression introduced in 2005, we need to throw
+       ArgumentNullException on Parse.
+
 2009-06-25  Miguel de Icaza  <miguel@novell.com>
 
        * Int32.cs: Fix regression introduced in 2005, we need to throw
index c703c4126bc3a25735d210d92a06ec8fa2984ee4..3eb95784612d8c09ed55c70b938687e5619b7f02 100644 (file)
@@ -229,6 +229,10 @@ namespace System {
                                                        "are permitted.");
                                        return false;
                                }
+                       } else if ((uint) style > (uint) NumberStyles.Any){
+                               if (!tryParse)
+                                       exc = new ArgumentException ("Not a valid number style");
+                               return false;
                        }
 
                        return true;
index 2b37a6556ccba3853a19bfb9148c68016a67a443..e8687d3af7a113a5463ef90da2c32ef10f48831b 100644 (file)
@@ -216,6 +216,13 @@ public class Int32Test : Assertion
                } catch (Exception e){
                        Assert ("C#40", typeof (ArgumentNullException) == e.GetType ());
                }
+
+               try {
+                       Int32.Parse ("123", (NumberStyles) 60000);
+                       Fail ("C#41 Should raise an ArgumentException");
+               } catch (Exception e){
+                       Assert ("C#42", typeof (ArgumentException) == e.GetType ());
+               }
        }
 
 #if NET_2_0