util: use ck_assert_ptr_eq() instead of ck_assert_ptr_null()
authorJosé Expósito <jose.exposito89@gmail.com>
Mon, 14 Nov 2022 18:06:07 +0000 (19:06 +0100)
committerJosé Expósito <jose.exposito89@gmail.com>
Mon, 14 Nov 2022 18:11:12 +0000 (19:11 +0100)
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 <jose.exposito89@gmail.com>
test/test-utils.c

index 08bdd59..ab3158a 100644 (file)
@@ -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++;