aboutsummaryrefslogtreecommitdiff
path: root/test/src/lst/test_ft_lstmap.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/lst/test_ft_lstmap.c
parentc128213daa677d548bfc2905496257fe4a4faf79 (diff)
parenta1675f56b35f5521a91851bae8ca650706374ae6 (diff)
downloadlibft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.tar.gz
libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.tar.bz2
libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.zip
Merge branch 'minishell'
Diffstat (limited to 'test/src/lst/test_ft_lstmap.c')
-rw-r--r--test/src/lst/test_ft_lstmap.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/test/src/lst/test_ft_lstmap.c b/test/src/lst/test_ft_lstmap.c
index 4abdddc..53c2f7a 100644
--- a/test/src/lst/test_ft_lstmap.c
+++ b/test/src/lst/test_ft_lstmap.c
@@ -29,54 +29,54 @@ TEST(ft_lstmap, basic)
mapped = ft_lstmap(lst, f_square, free);
TEST_ASSERT_NULL(mapped);
- ft_lstadd_front(&lst, ft_lstnew(&a));
+ ft_lstpush_front(&lst, ft_lstnew(&a));
mapped = ft_lstmap(lst, f_square, free);
TEST_ASSERT_NOT_NULL(mapped);
- TEST_ASSERT_NOT_NULL(mapped->content);
- TEST_ASSERT_EQUAL(4, *(int*)mapped->content);
+ TEST_ASSERT_NOT_NULL(mapped->data);
+ TEST_ASSERT_EQUAL(4, *(int*)mapped->data);
TEST_ASSERT_NULL(mapped->next);
- ft_lstclear(&mapped, free);
+ ft_lstdestroy(&mapped, free);
- ft_lstadd_front(&lst, ft_lstnew(&b));
+ ft_lstpush_front(&lst, ft_lstnew(&b));
mapped = ft_lstmap(lst, f_square, free);
TEST_ASSERT_NOT_NULL(mapped);
- TEST_ASSERT_NOT_NULL(mapped->content);
- TEST_ASSERT_EQUAL(9, *(int*)mapped->content);
+ TEST_ASSERT_NOT_NULL(mapped->data);
+ TEST_ASSERT_EQUAL(9, *(int*)mapped->data);
TEST_ASSERT_NOT_NULL(mapped->next);
- TEST_ASSERT_NOT_NULL(mapped->next->content);
- TEST_ASSERT_EQUAL(4, *(int*)mapped->next->content);
+ TEST_ASSERT_NOT_NULL(mapped->next->data);
+ TEST_ASSERT_EQUAL(4, *(int*)mapped->next->data);
TEST_ASSERT_NULL(mapped->next->next);
- ft_lstclear(&mapped, free);
+ ft_lstdestroy(&mapped, free);
- ft_lstadd_front(&lst, ft_lstnew(&c));
+ ft_lstpush_front(&lst, ft_lstnew(&c));
mapped = ft_lstmap(lst, f_square, free);
TEST_ASSERT_NOT_NULL(mapped);
- TEST_ASSERT_NOT_NULL(mapped->content);
- TEST_ASSERT_EQUAL(16, *(int*)mapped->content);
+ TEST_ASSERT_NOT_NULL(mapped->data);
+ TEST_ASSERT_EQUAL(16, *(int*)mapped->data);
TEST_ASSERT_NOT_NULL(mapped->next);
- TEST_ASSERT_NOT_NULL(mapped->next->content);
- TEST_ASSERT_EQUAL(9, *(int*)mapped->next->content);
+ TEST_ASSERT_NOT_NULL(mapped->next->data);
+ TEST_ASSERT_EQUAL(9, *(int*)mapped->next->data);
TEST_ASSERT_NOT_NULL(mapped->next->next);
- TEST_ASSERT_NOT_NULL(mapped->next->next->content);
- TEST_ASSERT_EQUAL(4, *(int*)mapped->next->next->content);
+ TEST_ASSERT_NOT_NULL(mapped->next->next->data);
+ TEST_ASSERT_EQUAL(4, *(int*)mapped->next->next->data);
TEST_ASSERT_NULL(mapped->next->next->next);
- ft_lstclear(&mapped, free);
+ ft_lstdestroy(&mapped, free);
- ft_lstadd_front(&lst, ft_lstnew(&d));
+ ft_lstpush_front(&lst, ft_lstnew(&d));
mapped = ft_lstmap(lst, f_square, free);
TEST_ASSERT_NOT_NULL(mapped);
- TEST_ASSERT_NOT_NULL(mapped->content);
- TEST_ASSERT_EQUAL(25, *(int*)mapped->content);
+ TEST_ASSERT_NOT_NULL(mapped->data);
+ TEST_ASSERT_EQUAL(25, *(int*)mapped->data);
TEST_ASSERT_NOT_NULL(mapped->next);
- TEST_ASSERT_NOT_NULL(mapped->next->content);
- TEST_ASSERT_EQUAL(16, *(int*)mapped->next->content);
+ TEST_ASSERT_NOT_NULL(mapped->next->data);
+ TEST_ASSERT_EQUAL(16, *(int*)mapped->next->data);
TEST_ASSERT_NOT_NULL(mapped->next->next);
- TEST_ASSERT_NOT_NULL(mapped->next->next->content);
- TEST_ASSERT_EQUAL(9, *(int*)mapped->next->next->content);
+ TEST_ASSERT_NOT_NULL(mapped->next->next->data);
+ TEST_ASSERT_EQUAL(9, *(int*)mapped->next->next->data);
TEST_ASSERT_NOT_NULL(mapped->next->next->next);
- TEST_ASSERT_NOT_NULL(mapped->next->next->next->content);
- TEST_ASSERT_EQUAL(4, *(int*)mapped->next->next->next->content);
- ft_lstclear(&mapped, free);
+ TEST_ASSERT_NOT_NULL(mapped->next->next->next->data);
+ TEST_ASSERT_EQUAL(4, *(int*)mapped->next->next->next->data);
+ ft_lstdestroy(&mapped, free);
- ft_lstclear(&lst, NULL);
+ ft_lstdestroy(&lst, NULL);
}