diff options
author | Miguel de Icaza <miguel@gnome.org> | 2006-10-18 03:20:14 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2006-10-18 03:20:14 +0400 |
commit | a2b2f87a22d69406641e1a1bd25b031b73e654c5 (patch) | |
tree | 09e8f18f38a958573cc3c4dd7be6b8760c8e87ce /eglib | |
parent | 02997a00cfaaf503e8365364a7004b3f19af0ca9 (diff) |
2006-10-17 Miguel de Icaza <miguel@novell.com>
* 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.
svn path=/trunk/mono/; revision=66771
Diffstat (limited to 'eglib')
-rw-r--r-- | eglib/ChangeLog | 5 | ||||
-rw-r--r-- | eglib/src/garray.c | 2 | ||||
-rw-r--r-- | eglib/test/array.c | 15 |
3 files changed, 21 insertions, 1 deletions
diff --git a/eglib/ChangeLog b/eglib/ChangeLog index dad588b4fde..b98bf27d42d 100644 --- a/eglib/ChangeLog +++ b/eglib/ChangeLog @@ -1,5 +1,10 @@ 2006-10-17 Miguel de Icaza <miguel@novell.com> + * 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. diff --git a/eglib/src/garray.c b/eglib/src/garray.c index 5e5f8a1ce3d..aee05826674 100644 --- a/eglib/src/garray.c +++ b/eglib/src/garray.c @@ -137,7 +137,7 @@ g_array_insert_vals (GArray *array, /* 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; diff --git a/eglib/test/array.c b/eglib/test/array.c index 8acea5bbaba..0fcb07eced8 100644 --- a/eglib/test/array.c +++ b/eglib/test/array.c @@ -84,6 +84,20 @@ test_array_append () } 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 @@ test_array_remove () 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}, |