mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-03 10:00:27 +01:00
util: use ck_assert_ptr_eq() instead of ck_assert_ptr_null()
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: eeae8906db ("util: return the number of elements from strv_from_string")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
This commit is contained in:
parent
eeae8906db
commit
955a9cc338
1 changed files with 5 additions and 5 deletions
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue