aboutsummaryrefslogtreecommitdiff
path: root/test/src/ht/test_ft_htset.c
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-04-01 21:51:51 +0200
committerCharles <sircharlesaze@gmail.com>2020-04-01 21:58:05 +0200
commit65c5d5157e890e9f9445a94fb2d7f660e5492d8e (patch)
tree78613f26bdc531104c3e32d76ffcaf3c2f7013f5 /test/src/ht/test_ft_htset.c
parentc128213daa677d548bfc2905496257fe4a4faf79 (diff)
parenta1675f56b35f5521a91851bae8ca650706374ae6 (diff)
downloadlibft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.tar.gz
libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.tar.bz2
libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.zip
Merge branch 'minishell'
Diffstat (limited to 'test/src/ht/test_ft_htset.c')
-rw-r--r--test/src/ht/test_ft_htset.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/src/ht/test_ft_htset.c b/test/src/ht/test_ft_htset.c
index 5fb3af6..96d848e 100644
--- a/test/src/ht/test_ft_htset.c
+++ b/test/src/ht/test_ft_htset.c
@@ -14,7 +14,7 @@ TEST_TEAR_DOWN(ft_htset)
/* ft_htdestroy_key(ht); */
}
-static void st_del(t_ftht_content *c)
+static void st_del(t_ftht_entry *c)
{
free(c->key);
free(c);
@@ -43,7 +43,7 @@ TEST(ft_htset, error_null)
TEST(ft_htset, happy_path)
{
- t_ftht_content *content = ft_htset(ht, "bonjour", strdup("content"), NULL);
+ t_ftht_entry *content = ft_htset(ht, "bonjour", strdup("content"), NULL);
TEST_ASSERT_NOT_NULL(content);
TEST_ASSERT_NOT_NULL(content->key);
TEST_ASSERT_NOT_NULL(content->value);
@@ -57,14 +57,14 @@ TEST(ft_htset, reset)
small = ft_htnew(3);
- t_ftht_content *content = ft_htset(small, "bonjour", ft_strdup("content"), st_del);
+ t_ftht_entry *content = ft_htset(small, "bonjour", ft_strdup("content"), st_del);
TEST_ASSERT_NOT_NULL(content);
TEST_ASSERT_NOT_NULL(content->key);
TEST_ASSERT_NOT_NULL(content->value);
TEST_ASSERT_EQUAL_STRING(content->key, "bonjour");
TEST_ASSERT_EQUAL_STRING(content->value, "content");
- t_ftht_content *content_re = ft_htset(small, "bonjour", ft_strdup("yo"), st_del);
+ t_ftht_entry *content_re = ft_htset(small, "bonjour", ft_strdup("yo"), st_del);
TEST_ASSERT_NOT_NULL(content_re);
TEST_ASSERT_NOT_NULL(content_re->key);
TEST_ASSERT_NOT_NULL(content_re->value);
@@ -77,21 +77,21 @@ TEST(ft_htset, collision)
t_ftht *small = NULL;
small = ft_htnew(1);
- t_ftht_content *content1 = ft_htset(small, "bonjour", strdup("content1"), st_del);
+ t_ftht_entry *content1 = ft_htset(small, "bonjour", strdup("content1"), st_del);
TEST_ASSERT_NOT_NULL(content1);
TEST_ASSERT_NOT_NULL(content1->key);
TEST_ASSERT_NOT_NULL(content1->value);
TEST_ASSERT_EQUAL_STRING(content1->key, "bonjour");
TEST_ASSERT_EQUAL_STRING(content1->value, "content1");
- t_ftht_content *content2 = ft_htset(small, "aurevoir", strdup("content2"), st_del);
+ t_ftht_entry *content2 = ft_htset(small, "aurevoir", strdup("content2"), st_del);
TEST_ASSERT_NOT_NULL(content2);
TEST_ASSERT_NOT_NULL(content2->key);
TEST_ASSERT_NOT_NULL(content2->value);
TEST_ASSERT_EQUAL_STRING(content2->key, "aurevoir");
TEST_ASSERT_EQUAL_STRING(content2->value, "content2");
- t_ftht_content *content3 = ft_htset(small, "aloa", strdup("content3"), st_del);
+ t_ftht_entry *content3 = ft_htset(small, "aloa", strdup("content3"), st_del);
TEST_ASSERT_NOT_NULL(content3);
TEST_ASSERT_NOT_NULL(content3->key);
TEST_ASSERT_NOT_NULL(content3->value);