aboutsummaryrefslogtreecommitdiff
path: root/test/src/algo/test_ft_is_set.c
blob: 604ec53ca29b84ea03ac9b2e10efd17bf1156441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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));
}