From 955a9cc338b7a1d6606a05ab6c0f5b7145806cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Mon, 14 Nov 2022 19:06:07 +0100 Subject: [PATCH] util: use ck_assert_ptr_eq() instead of ck_assert_ptr_null() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ck_assert_ptr_null() function is not available in the version of the check library included in 20.04 LTS Focal (0.10.0). Use ck_assert_ptr_eq() to avoid compilation errors. Fixes: eeae8906dbbb ("util: return the number of elements from strv_from_string") Signed-off-by: José Expósito --- test/test-utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test-utils.c b/test/test-utils.c index 08bdd59a..ab3158a9 100644 --- a/test/test-utils.c +++ b/test/test-utils.c @@ -1097,17 +1097,17 @@ START_TEST(strsplit_test) size_t nelem; char **strv = strv_from_string(t->string, t->delim, &nelem); - for (size_t idx = 0; idx < t->nresults; idx++) + for (size_t idx = 0; idx < t->nresults; idx++) ck_assert_str_eq(t->results[idx], strv[idx]); - + ck_assert_uint_eq(nelem, t->nresults); - + /* When there are no elements validate return value is Null, otherwise validate result array is Null terminated. */ if(t->nresults == 0) - ck_assert_ptr_null(strv); + ck_assert_ptr_eq(strv, NULL); else - ck_assert_ptr_null(strv[t->nresults]); + ck_assert_ptr_eq(strv[t->nresults], NULL); strv_free(strv); t++;