Author: atsushi
Date: 2005-04-17 00:06:34 -0400 (Sun, 17 Apr 2005)
New Revision: 43137

Modified:
   trunk/mcs/class/System.Data/System.Data/ChangeLog
   trunk/mcs/class/System.Data/System.Data/DataView.cs
   trunk/mcs/class/System.Data/Test/System.Data/ChangeLog
   trunk/mcs/class/System.Data/Test/System.Data/DataViewTest.cs
Log:
2005-04-17  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * DataView.cs : Delete() should not try to remove row twice.
          Fixed bug #74631.

        * DataViewTest.cs : added more test for Delete() based on bug #74631.



Modified: trunk/mcs/class/System.Data/System.Data/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data/ChangeLog   2005-04-17 03:23:49 UTC 
(rev 43136)
+++ trunk/mcs/class/System.Data/System.Data/ChangeLog   2005-04-17 04:06:34 UTC 
(rev 43137)
@@ -1,3 +1,8 @@
+2005-04-17  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * DataView.cs : Delete() should not try to remove row twice.
+         Fixed bug #74631.
+
 2005-04-13  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * DataTable.cs : Use GetRowType() for the base of the returning array 

Modified: trunk/mcs/class/System.Data/System.Data/DataView.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data/DataView.cs 2005-04-17 03:23:49 UTC 
(rev 43136)
+++ trunk/mcs/class/System.Data/System.Data/DataView.cs 2005-04-17 04:06:34 UTC 
(rev 43137)
@@ -377,7 +377,7 @@
                                throw new IndexOutOfRangeException ("There is 
no row at " +
                                                "position: " + index + ".");
                        DataRowView row = this [index];
-                       row.Row.Delete ();
+                       DeleteRowView (row);
                }
 
 #if NET_2_0

Modified: trunk/mcs/class/System.Data/Test/System.Data/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/Test/System.Data/ChangeLog      2005-04-17 
03:23:49 UTC (rev 43136)
+++ trunk/mcs/class/System.Data/Test/System.Data/ChangeLog      2005-04-17 
04:06:34 UTC (rev 43137)
@@ -1,3 +1,7 @@
+2005-04-17  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * DataViewTest.cs : added more test for Delete() based on bug #74631.
+
 2005-02-25  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * DataColumnTest.cs : added testcase for setting negative value on

Modified: trunk/mcs/class/System.Data/Test/System.Data/DataViewTest.cs
===================================================================
--- trunk/mcs/class/System.Data/Test/System.Data/DataViewTest.cs        
2005-04-17 03:23:49 UTC (rev 43136)
+++ trunk/mcs/class/System.Data/Test/System.Data/DataViewTest.cs        
2005-04-17 04:06:34 UTC (rev 43137)
@@ -412,6 +412,29 @@
                        TestView.Delete (0);
                }
 
+               [Test] // based on bug #74631
+               public void TestDeleteAndCount ()
+               {
+                       DataSet dataset = new DataSet ("new");
+                       DataTable dt = new DataTable ("table1");
+                       dataset.Tables.Add (dt);
+                       dt.Columns.Add ("col1");
+                       dt.Columns.Add ("col2");
+                       dt.Rows.Add (new object []{1,1});
+                       dt.Rows.Add (new object []{1,2});
+                       dt.Rows.Add (new object []{1,3});
+
+                       DataView dataView = new DataView (dataset.Tables[0]);
+
+                       AssertEquals ("before delete", 3, dataView.Count);
+                       dataView.AllowDelete = true;
+
+                       // Deleting the first row
+                       dataView.Delete (0);
+
+                       AssertEquals ("before delete", 2, dataView.Count);
+               }
+
                [Test]
                public void ListChangeOnSetItem ()
                {

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

Reply via email to