diff options
Diffstat (limited to 'test/src/algo/test_ft_is_set.c')
| -rw-r--r-- | test/src/algo/test_ft_is_set.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/src/algo/test_ft_is_set.c b/test/src/algo/test_ft_is_set.c new file mode 100644 index 0000000..604ec53 --- /dev/null +++ b/test/src/algo/test_ft_is_set.c @@ -0,0 +1,23 @@ +#include "libft_test.h" + +TEST_GROUP(ft_is_set); + +TEST_SETUP(ft_is_set) +{} + +TEST_TEAR_DOWN(ft_is_set) +{} + +static int compar(const void *a, const void *b) +{ + return *(int*)a - *(int*)b; +} + +TEST(ft_is_set, basic) +{ + int arr[] = {3, 4, 1, 2, 7, 189, -1, -134, 7, 1, 34}; + int unique_arr[] = {3, 4, 2, 189, -1, -134, 7, 1, 34}; + + TEST_ASSERT_FALSE(ft_is_set(arr, sizeof(arr) / sizeof(int), sizeof(int), compar)); + TEST_ASSERT_TRUE(ft_is_set(unique_arr, sizeof(unique_arr) / sizeof(int), sizeof(int), compar)); +} |
