mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-20 22:29:17 +02:00
Fix access to freed memory in test case (Miroslaw Dobrzanski-Neumann).
Fri Feb 8 12:32:14 2002 Owen Taylor <otaylor@redhat.com> * tests/hash-test.c (second_hash_test): Fix access to freed memory in test case (Miroslaw Dobrzanski-Neumann). Re-enable and debug some commented out code.
This commit is contained in:
parent
147ca6cbc8
commit
31e7c4b6fb
@ -1,3 +1,9 @@
|
|||||||
|
Fri Feb 8 12:32:14 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* tests/hash-test.c (second_hash_test): Fix access to
|
||||||
|
freed memory in test case (Miroslaw Dobrzanski-Neumann).
|
||||||
|
Re-enable and debug some commented out code.
|
||||||
|
|
||||||
2002-02-08 Michael Natterer <mitch@gimp.org>
|
2002-02-08 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Fri Feb 8 12:32:14 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* tests/hash-test.c (second_hash_test): Fix access to
|
||||||
|
freed memory in test case (Miroslaw Dobrzanski-Neumann).
|
||||||
|
Re-enable and debug some commented out code.
|
||||||
|
|
||||||
2002-02-08 Michael Natterer <mitch@gimp.org>
|
2002-02-08 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Fri Feb 8 12:32:14 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* tests/hash-test.c (second_hash_test): Fix access to
|
||||||
|
freed memory in test case (Miroslaw Dobrzanski-Neumann).
|
||||||
|
Re-enable and debug some commented out code.
|
||||||
|
|
||||||
2002-02-08 Michael Natterer <mitch@gimp.org>
|
2002-02-08 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Fri Feb 8 12:32:14 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* tests/hash-test.c (second_hash_test): Fix access to
|
||||||
|
freed memory in test case (Miroslaw Dobrzanski-Neumann).
|
||||||
|
Re-enable and debug some commented out code.
|
||||||
|
|
||||||
2002-02-08 Michael Natterer <mitch@gimp.org>
|
2002-02-08 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Fri Feb 8 12:32:14 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* tests/hash-test.c (second_hash_test): Fix access to
|
||||||
|
freed memory in test case (Miroslaw Dobrzanski-Neumann).
|
||||||
|
Re-enable and debug some commented out code.
|
||||||
|
|
||||||
2002-02-08 Michael Natterer <mitch@gimp.org>
|
2002-02-08 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Fri Feb 8 12:32:14 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* tests/hash-test.c (second_hash_test): Fix access to
|
||||||
|
freed memory in test case (Miroslaw Dobrzanski-Neumann).
|
||||||
|
Re-enable and debug some commented out code.
|
||||||
|
|
||||||
2002-02-08 Michael Natterer <mitch@gimp.org>
|
2002-02-08 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Fri Feb 8 12:32:14 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* tests/hash-test.c (second_hash_test): Fix access to
|
||||||
|
freed memory in test case (Miroslaw Dobrzanski-Neumann).
|
||||||
|
Re-enable and debug some commented out code.
|
||||||
|
|
||||||
2002-02-08 Michael Natterer <mitch@gimp.org>
|
2002-02-08 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
Fri Feb 8 12:32:14 2002 Owen Taylor <otaylor@redhat.com>
|
||||||
|
|
||||||
|
* tests/hash-test.c (second_hash_test): Fix access to
|
||||||
|
freed memory in test case (Miroslaw Dobrzanski-Neumann).
|
||||||
|
Re-enable and debug some commented out code.
|
||||||
|
|
||||||
2002-02-08 Michael Natterer <mitch@gimp.org>
|
2002-02-08 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
* glib/gdir.c: g_dir_open: added g_return_val_if_fail() to prevent
|
||||||
|
@ -189,7 +189,6 @@ static void not_even_foreach (gpointer key,
|
|||||||
g_assert (*_value != 0);
|
g_assert (*_value != 0);
|
||||||
|
|
||||||
i = atoi (_key);
|
i = atoi (_key);
|
||||||
g_assert (atoi (_key) > 0);
|
|
||||||
|
|
||||||
sprintf (val, "%d value", i);
|
sprintf (val, "%d value", i);
|
||||||
g_assert (strcmp (_value, val) == 0);
|
g_assert (strcmp (_value, val) == 0);
|
||||||
@ -214,7 +213,6 @@ static gboolean remove_even_foreach (gpointer key,
|
|||||||
g_assert (*_value != 0);
|
g_assert (*_value != 0);
|
||||||
|
|
||||||
i = atoi (_key);
|
i = atoi (_key);
|
||||||
g_assert (i > 0);
|
|
||||||
|
|
||||||
sprintf (val, "%d value", i);
|
sprintf (val, "%d value", i);
|
||||||
g_assert (strcmp (_value, val) == 0);
|
g_assert (strcmp (_value, val) == 0);
|
||||||
@ -262,17 +260,15 @@ static void second_hash_test (gboolean simple_hash)
|
|||||||
g_assert (atoi (v) == i);
|
g_assert (atoi (v) == i);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**** future test stuff, yet to be debugged
|
|
||||||
sprintf (key, "%d", 3);
|
sprintf (key, "%d", 3);
|
||||||
g_hash_table_remove (h, key);
|
g_hash_table_remove (h, key);
|
||||||
g_hash_table_foreach_remove (h, remove_even_foreach, NULL);
|
g_hash_table_foreach_remove (h, remove_even_foreach, NULL);
|
||||||
g_hash_table_foreach (h, not_even_foreach, NULL);
|
g_hash_table_foreach (h, not_even_foreach, NULL);
|
||||||
*/
|
|
||||||
|
|
||||||
for (i=0; i<20; i++)
|
for (i=0; i<20; i++)
|
||||||
{
|
{
|
||||||
if (((i % 2) == 0) || (i == 3))
|
if ((i % 2) == 0 || i == 3)
|
||||||
i++;
|
continue;
|
||||||
|
|
||||||
sprintf (key, "%d", i);
|
sprintf (key, "%d", i);
|
||||||
g_assert (atoi(key) == i);
|
g_assert (atoi(key) == i);
|
||||||
@ -286,6 +282,8 @@ static void second_hash_test (gboolean simple_hash)
|
|||||||
(gpointer)&orig_val);
|
(gpointer)&orig_val);
|
||||||
g_assert (found);
|
g_assert (found);
|
||||||
|
|
||||||
|
g_hash_table_remove (h, key);
|
||||||
|
|
||||||
g_assert (orig_key != NULL);
|
g_assert (orig_key != NULL);
|
||||||
g_assert (strcmp (key, orig_key) == 0);
|
g_assert (strcmp (key, orig_key) == 0);
|
||||||
g_free (orig_key);
|
g_free (orig_key);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user