aboutsummaryrefslogtreecommitdiff
path: root/test/src/lst/test_ft_lstlfind.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-18 16:39:52 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-18 16:39:52 +0200
commitdd0c485ac4975b7dd6d2e230213be1da50d0a065 (patch)
tree5fbd967f8b95c72fbb696bb089c2cc349d28b61f /test/src/lst/test_ft_lstlfind.c
parent3c3f1115f6e9a9b914e2dcbd796501ca7ce85342 (diff)
downloadlibft-malloc.tar.gz
libft-malloc.tar.bz2
libft-malloc.zip
Removing unnecessary stuffmalloc
Diffstat (limited to 'test/src/lst/test_ft_lstlfind.c')
-rw-r--r--test/src/lst/test_ft_lstlfind.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/test/src/lst/test_ft_lstlfind.c b/test/src/lst/test_ft_lstlfind.c
deleted file mode 100644
index 493a8ad..0000000
--- a/test/src/lst/test_ft_lstlfind.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* test_ft_lstlfind.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2020/02/17 03:08:15 by cacharle #+# #+# */
-/* Updated: 2020/02/17 03:34:40 by cacharle ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-#include "libft_test.h"
-
-TEST_GROUP(ft_lstlfind);
-
-TEST_SETUP(ft_lstlfind)
-{}
-
-TEST_TEAR_DOWN(ft_lstlfind)
-{}
-
-TEST(ft_lstlfind, basic)
-{
- t_ftlst *found = NULL;
- t_ftlst *lst = NULL;
- int a = 1;
- int b = 2;
- int c = 3;
- int d = 4;
-
- ft_lstadd_front(&lst, ft_lstnew(&c));
- ft_lstadd_front(&lst, ft_lstnew(&c));
- ft_lstadd_front(&lst, ft_lstnew(&a));
- ft_lstadd_front(&lst, ft_lstnew(&c));
- ft_lstadd_front(&lst, ft_lstnew(&b));
- ft_lstadd_front(&lst, ft_lstnew(&a));
- ft_lstadd_front(&lst, ft_lstnew(&a));
-
- found = ft_lstlfind(lst, ft_compar_int, &c);
- TEST_ASSERT_EQUAL_PTR(lst->next->next->next, found);
- found = ft_lstlfind(lst, ft_compar_int, &c);
- TEST_ASSERT_EQUAL_PTR(lst->next->next->next, found);
-
- found = ft_lstlfind(lst, ft_compar_int, &b);
- TEST_ASSERT_EQUAL_PTR(lst->next->next, found);
-
- found = ft_lstlfind(lst, ft_compar_int, &a);
- TEST_ASSERT_EQUAL_PTR(lst, found);
-
- found = ft_lstlfind(lst, ft_compar_int, &d);
- TEST_ASSERT_NULL(found);
-
- ft_lstclear(&lst, NULL);
-}