diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-list_util.c | 25 | ||||
-rw-r--r-- | tests/test-vector.c | 4 |
2 files changed, 15 insertions, 14 deletions
diff --git a/tests/test-list_util.c b/tests/test-list_util.c index a3c6ad59..c4e88502 100644 --- a/tests/test-list_util.c +++ b/tests/test-list_util.c @@ -1,4 +1,5 @@ #include <zebra.h> +#include "misc.h" #include <list_util.h> #include <string.h> @@ -253,12 +254,12 @@ test_ssl(void) this = base ; first = base->next ; ret = ssl_del(base, this, next) ; - test_assert(ret == 0, "ssl_del did not return 0") ; + test_assert(ret == true, "ssl_del did not return true") ; test_assert(first == base, "ssl_del of first item failed") ; this = other->base ; ret = ssl_del(other->base, this, other_next) ; - test_assert(ret == 0, "ssl_del did not return 0") ; + test_assert(ret == true, "ssl_del did not return true") ; test_assert(first == other->base, "ssl_del of first item failed") ; printf("\n") ; @@ -271,9 +272,9 @@ test_ssl(void) */ printf(" Deleting arbitrary items") ; ret = ssl_del(base, del, next) ; - test_assert(ret == 0, "ssl_del did not return 0") ; + test_assert(ret == true, "ssl_del did not return true") ; ret = ssl_del(ssl_parent.base, other_del, other_next) ; - test_assert(ret == 0, "ssl_del did not return 0") ; + test_assert(ret == true, "ssl_del did not return true") ; printf("\n") ; /* Deletion of items from arbitrary place in list @@ -282,9 +283,9 @@ test_ssl(void) */ printf(" Deleting non-existant items") ; ret = ssl_del(base, &dummy, next) ; - test_assert(ret == -1, "ssl_del did not return -1") ; + test_assert(ret == false, "ssl_del did not return false") ; ret = ssl_del(other->base, &dummy, other_next) ; - test_assert(ret == -1, "ssl_del did not return -1") ; + test_assert(ret == false, "ssl_del did not return false") ; printf("\n") ; /* Deletion of NULL items @@ -296,10 +297,10 @@ test_ssl(void) this = NULL ; ret = ssl_del(base, this, next) ; - test_assert(ret == 0, "ssl_del did not return 0") ; + test_assert(ret == false, "ssl_del did not return false") ; ret = ssl_del(ssl_parent.base, this, other_next) ; - test_assert(ret == 0, "ssl_del did not return 0") ; + test_assert(ret == false, "ssl_del did not return false") ; printf("\n") ; @@ -567,21 +568,21 @@ test_ssl(void) test_assert(other->base == NULL, "ssl_del of first and only item failed") ; ret = ssl_del(base, del, next) ; - test_assert(ret == -1, "ssl_del did not return -1") ; + test_assert(ret == false, "ssl_del did not return false") ; test_assert(base == NULL, "ssl_del on empty list") ; ret = ssl_del(other->base, other_del, other_next) ; - test_assert(ret == -1, "ssl_del did not return -1") ; + test_assert(ret == false, "ssl_del did not return false") ; test_assert(other->base == NULL, "ssl_del on empty list") ; this = NULL ; ret = ssl_del(base, this, next) ; - test_assert(ret == 0, "ssl_del did not return 0") ; + test_assert(ret == false, "ssl_del did not return false") ; test_assert(base == NULL, "ssl_del on empty list") ; ret = ssl_del(other->base, this, other_next) ; - test_assert(ret == 0, "ssl_del did not return 0") ; + test_assert(ret == false, "ssl_del did not return false") ; test_assert(other->base == NULL, "ssl_del on empty list") ; printf("\n") ; diff --git a/tests/test-vector.c b/tests/test-vector.c index a73e5637..e95e3c58 100644 --- a/tests/test-vector.c +++ b/tests/test-vector.c @@ -25,7 +25,7 @@ void test_vector_insert_item(void); void test_vector_insert_item_here(void); void test_vector_delete_item(void); void do_test_insert(const int rider); -int sort_cmp(const void** a, const void** b); +int sort_cmp(void const* const* a, void const* const* b); void test_vector_sort(void); void test_vector_bsearch(void); void test_vector_move_item_here(void); @@ -550,7 +550,7 @@ test_vector_sort(void) } int -sort_cmp(const void** a, const void** b) +sort_cmp(void const* const* a, void const* const* b) { return strcmp(*a, *b); } |