aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-07-24 18:15:10 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-07-24 18:15:10 +0200
commit282e2d4ec17f251ffbfa29e45bede693c2fedec9 (patch)
treed920042ba893ec911533f6f792388eb323b8858c /tests
parent8a4e6248052ff32e02dcec3dd6850d4582836fb5 (diff)
downloadblogc-282e2d4ec17f251ffbfa29e45bede693c2fedec9.tar.gz
blogc-282e2d4ec17f251ffbfa29e45bede693c2fedec9.tar.bz2
blogc-282e2d4ec17f251ffbfa29e45bede693c2fedec9.zip
tests: common: sort: fixes
Diffstat (limited to 'tests')
-rw-r--r--tests/common/check_sort.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/common/check_sort.c b/tests/common/check_sort.c
index 3c4764f..f49710c 100644
--- a/tests/common/check_sort.c
+++ b/tests/common/check_sort.c
@@ -11,6 +11,7 @@
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>
+#include <string.h>
#include "../../src/common/utils.h"
#include "../../src/common/sort.h"
@@ -26,7 +27,7 @@ static void
test_slist_sort_empty(void **state)
{
bc_slist_t *l = NULL;
- assert_null(bc_slist_sort(l, sort_func));
+ assert_null(bc_slist_sort(l, (bc_sort_func_t) sort_func));
}
@@ -36,7 +37,7 @@ test_slist_sort_single(void **state)
bc_slist_t *l = NULL;
l = bc_slist_append(l, bc_strdup("a"));
- l = bc_slist_sort(l, sort_func);
+ l = bc_slist_sort(l, (bc_sort_func_t) sort_func);
assert_non_null(l);
assert_string_equal(l->data, "a");
@@ -54,7 +55,7 @@ test_slist_sort_sorted(void **state)
l = bc_slist_append(l, bc_strdup("b"));
l = bc_slist_append(l, bc_strdup("c"));
- l = bc_slist_sort(l, sort_func);
+ l = bc_slist_sort(l, (bc_sort_func_t) sort_func);
assert_non_null(l);
assert_string_equal(l->data, "a");
@@ -75,7 +76,7 @@ test_slist_sort_reverse(void **state)
l = bc_slist_append(l, bc_strdup("b"));
l = bc_slist_append(l, bc_strdup("a"));
- l = bc_slist_sort(l, sort_func);
+ l = bc_slist_sort(l, (bc_sort_func_t) sort_func);
assert_non_null(l);
assert_string_equal(l->data, "a");
@@ -97,7 +98,7 @@ test_slist_sort_mixed1(void **state)
l = bc_slist_append(l, bc_strdup("c"));
l = bc_slist_append(l, bc_strdup("b"));
- l = bc_slist_sort(l, sort_func);
+ l = bc_slist_sort(l, (bc_sort_func_t) sort_func);
assert_non_null(l);
assert_string_equal(l->data, "a");
@@ -119,7 +120,7 @@ test_slist_sort_mixed2(void **state)
l = bc_slist_append(l, bc_strdup("a"));
l = bc_slist_append(l, bc_strdup("d"));
- l = bc_slist_sort(l, sort_func);
+ l = bc_slist_sort(l, (bc_sort_func_t) sort_func);
assert_non_null(l);
assert_string_equal(l->data, "a");