aboutsummaryrefslogtreecommitdiff
path: root/test/src/algo/test_ft_lfind.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/algo/test_ft_lfind.c
parent3c3f1115f6e9a9b914e2dcbd796501ca7ce85342 (diff)
downloadlibft-malloc.tar.gz
libft-malloc.tar.bz2
libft-malloc.zip
Removing unnecessary stuffmalloc
Diffstat (limited to 'test/src/algo/test_ft_lfind.c')
-rw-r--r--test/src/algo/test_ft_lfind.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/test/src/algo/test_ft_lfind.c b/test/src/algo/test_ft_lfind.c
deleted file mode 100644
index 0080d55..0000000
--- a/test/src/algo/test_ft_lfind.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "libft_test.h"
-
-TEST_GROUP(ft_lfind);
-
-TEST_SETUP(ft_lfind)
-{}
-
-TEST_TEAR_DOWN(ft_lfind)
-{}
-
-TEST(ft_lfind, basic)
-{
- int arr[] = {3, 4, 1, 2, 7, 189, -1, -134, 7, 1, 34};
- t_ftsearch_const consts;
-
- int a = 189;
- consts.key = &a;
- consts.compar = ft_compar_int;
-
- size_t nelp = sizeof(arr) / sizeof(int);
- void *ptr = ft_lfind(arr, &nelp, sizeof(int), &consts);
- TEST_ASSERT_EQUAL_PTR(arr + 5, ptr);
-
- int b = 123;
- consts.key = &b;
- ptr = ft_lfind(arr, &nelp, sizeof(int), &consts);
- TEST_ASSERT_NULL(ptr);
-
- int c = 34;
- consts.key = &c;
- ptr = ft_lfind(arr, &nelp, sizeof(int), &consts);
- TEST_ASSERT_EQUAL_PTR(arr + 10, ptr);
-
- int d = 3;
- consts.key = &d;
- ptr = ft_lfind(arr, &nelp, sizeof(int), &consts);
- TEST_ASSERT_EQUAL_PTR(arr, ptr);
-}