Author: miguel
Date: 2006-10-17 19:20:14 -0400 (Tue, 17 Oct 2006)
New Revision: 66771

Modified:
   trunk/mono/eglib/ChangeLog
   trunk/mono/eglib/src/garray.c
   trunk/mono/eglib/test/array.c
Log:
2006-10-17  Miguel de Icaza  <[EMAIL PROTECTED]>

        * src/garray.c (g_array_insert_vals): Should actually use the
        number of elements to insert.

        * test/array.c: Add new test case, this was happening in the JIT. 



Modified: trunk/mono/eglib/ChangeLog
===================================================================
--- trunk/mono/eglib/ChangeLog  2006-10-17 22:59:36 UTC (rev 66770)
+++ trunk/mono/eglib/ChangeLog  2006-10-17 23:20:14 UTC (rev 66771)
@@ -1,5 +1,10 @@
 2006-10-17  Miguel de Icaza  <[EMAIL PROTECTED]>
 
+       * src/garray.c (g_array_insert_vals): Should actually use the
+       number of elements to insert.
+
+       * test/array.c: Add new test case, this was happening in the JIT. 
+
        * Add _GNU_SOURCE at configure time, remove from sources.
        
        * src/gstr.c (g_strsplit): Empty strings return a 0 value vector.

Modified: trunk/mono/eglib/src/garray.c
===================================================================
--- trunk/mono/eglib/src/garray.c       2006-10-17 22:59:36 UTC (rev 66770)
+++ trunk/mono/eglib/src/garray.c       2006-10-17 23:20:14 UTC (rev 66771)
@@ -137,7 +137,7 @@
        /* then copy the new elements into the array */
        memmove (element_offset (priv, array->len),
                 data,
-                element_length (priv, index_));
+                element_length (priv, len));
 
        array->len += len;
 

Modified: trunk/mono/eglib/test/array.c
===================================================================
--- trunk/mono/eglib/test/array.c       2006-10-17 22:59:36 UTC (rev 66770)
+++ trunk/mono/eglib/test/array.c       2006-10-17 23:20:14 UTC (rev 66771)
@@ -84,6 +84,20 @@
 }
 
 RESULT
+test_array_append2 ()
+{
+       GArray *array = g_array_new (FALSE, FALSE, sizeof (gpointer));
+
+       g_array_insert_val (array, 0, array);
+
+       if (array != g_array_index (array, gpointer, 0))
+               return FAILED ("The value in the array is incorrect");
+
+       g_array_free (array, TRUE);
+       return NULL;
+}
+
+RESULT
 test_array_remove ()
 {
        GArray *array = g_array_new (FALSE, FALSE, sizeof (int));
@@ -110,6 +124,7 @@
 static Test array_tests [] = {
        {"big", test_array_big},
        {"append", test_array_append},
+       {"append2", test_array_append2},
        {"index", test_array_index},
        {"remove", test_array_remove},
        {"append_zero_term", test_array_append_zero_terminated},

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

Reply via email to