2004-04-29 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 29 Apr 2004 07:43:45 +0000 (07:43 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 29 Apr 2004 07:43:45 +0000 (07:43 -0000)
* DataRowTest.cs : Added a test for auto increment column and item
  integrity (it caused index out of range exception).

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

mcs/class/System.Data/Test/System.Data/ChangeLog
mcs/class/System.Data/Test/System.Data/DataRowTest.cs

index 4f27865732a2b530f0f8c5f22e60244ea237fb81..704b9358073688b5447448deec413b147cb2a818 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-29  Atsushi Enomoto <atsushi@ximian.com>
+
+       * DataRowTest.cs : Added a test for auto increment column and item
+         integrity (it caused index out of range exception).
+
 2004-04-27  Atsushi Enomoto <atsushi@ximian.com>
 
        * ConstraintCollectionTest.cs,
index 40ea41b87c1ffb0b811e6e4183822cdb59de7af7..5defbdcdd0ba4277dd5e059b269e47cd58165b2d 100644 (file)
@@ -718,5 +718,19 @@ namespace MonoTests.System.Data
                        ValueTest("DR46: array smaller value test", table, 6, 0, abc);
                        ValueTest("DR47: array smaller value test", table, 6, 1, 14);
                }
+
+               [Test]
+               public void AutoIncrementColumnIntegrity ()
+               {
+                       // AutoIncrement-column shouldn't raise index out of range
+                       // exception because of size mismatch of internal itemarray.
+                       DataTable dt = new DataTable ();\r
+                       dt.Columns.Add ("foo");\r
+                       dt.Rows.Add (new object [] {"value"});\r
+                       DataColumn col = new DataColumn ("bar");\r
+                       col.AutoIncrement = true;\r
+                       dt.Columns.Add (col);\r
+                       dt.Rows [0] [0] = "test";
+               }
        }
 }