From adbcf69ed50ea3896d4bbe863ea5d214ae5a0299 Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 13 Feb 2020 23:15:16 +0100 Subject: Added tests for algo*, fixing ft_bsearch and ft_mergesort --- test/src/algo/test_ft_compar_int.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/src/algo/test_ft_compar_int.c (limited to 'test/src/algo/test_ft_compar_int.c') diff --git a/test/src/algo/test_ft_compar_int.c b/test/src/algo/test_ft_compar_int.c new file mode 100644 index 0000000..39cc322 --- /dev/null +++ b/test/src/algo/test_ft_compar_int.c @@ -0,0 +1,20 @@ +#include "libft_test.h" + +TEST_GROUP(ft_compar_int); + +TEST_SETUP(ft_compar_int) +{} + +TEST_TEAR_DOWN(ft_compar_int) +{} + +TEST(ft_compar_int, basic) +{ + int a = 4; + int b = 3; + + TEST_ASSERT_GREATER_THAN(0, ft_compar_int(&a, &b)); + TEST_ASSERT_LESS_THAN(0, ft_compar_int(&b, &a)); + TEST_ASSERT_EQUAL(0, ft_compar_int(&a, &a)); + TEST_ASSERT_EQUAL(0, ft_compar_int(&b, &b)); +} -- cgit