From d2feec1f97e9f8f201e56ad33662bb663c328a0a Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 3 Apr 2020 07:19:25 +0200 Subject: Changing hash table del function to regular one with a first order internal function, removing a few typedef to instead use standard types --- test/src/ht/test_ft_htdestroy.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'test/src/ht/test_ft_htdestroy.c') diff --git a/test/src/ht/test_ft_htdestroy.c b/test/src/ht/test_ft_htdestroy.c index 1512a48..4d212e1 100644 --- a/test/src/ht/test_ft_htdestroy.c +++ b/test/src/ht/test_ft_htdestroy.c @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/19 02:45:27 by cacharle #+# #+# */ -/* Updated: 2020/02/19 02:49:36 by cacharle ### ########.fr */ +/* Updated: 2020/04/03 07:07:07 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -20,19 +20,13 @@ TEST_SETUP(ft_htdestroy) TEST_TEAR_DOWN(ft_htdestroy) {} -static void st_del(t_ftht_entry *v) -{ - free(v->key); - free(v); -} - TEST(ft_htdestroy, basic) { t_ftht *ht = ft_htnew(2); - ft_htset(ht, "a", "1", st_del); - ft_htset(ht, "b", "2", st_del); - ft_htset(ht, "c", "3", st_del); - ft_htset(ht, "d", "4", st_del); - ft_htdestroy(ht, st_del); + ft_htset(ht, "a", strdup("1"), free); + ft_htset(ht, "b", strdup("2"), free); + ft_htset(ht, "c", "3", NULL); + ft_htset(ht, "d", "4", NULL); + ft_htdestroy(ht, NULL); } -- cgit