tests: fdtable: Fix compilation as z_get_fd_obj_and_vtable() changed
3rd parameter (struct k_mutex *) was added to z_get_fd_obj_and_vtable() so add it to calls in the tests. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
b0d9ea1308
commit
ef074d9786
1 changed files with 9 additions and 8 deletions
|
@ -37,7 +37,8 @@ void test_z_get_fd_obj_and_vtable(void)
|
|||
zassert_true(fd >= 0, "fd < 0");
|
||||
|
||||
int *obj;
|
||||
obj = z_get_fd_obj_and_vtable(fd, &vtable); /* function being tested */
|
||||
obj = z_get_fd_obj_and_vtable(fd, &vtable,
|
||||
NULL); /* function being tested */
|
||||
|
||||
zassert_is_null(obj, "obj is not NULL");
|
||||
|
||||
|
@ -85,14 +86,14 @@ void test_z_finalize_fd(void)
|
|||
int fd = z_reserve_fd();
|
||||
zassert_true(fd >= 0, NULL);
|
||||
|
||||
int *obj = z_get_fd_obj_and_vtable(fd, &vtable);
|
||||
int *obj = z_get_fd_obj_and_vtable(fd, &vtable, NULL);
|
||||
|
||||
const struct fd_op_vtable *original_vtable = vtable;
|
||||
int *original_obj = obj;
|
||||
|
||||
z_finalize_fd(fd, obj, vtable); /* function being tested */
|
||||
|
||||
obj = z_get_fd_obj_and_vtable(fd, &vtable);
|
||||
obj = z_get_fd_obj_and_vtable(fd, &vtable, NULL);
|
||||
|
||||
zassert_equal_ptr(obj, original_obj, "obj is different after finalizing");
|
||||
zassert_equal_ptr(vtable, original_vtable, "vtable is different after finalizing");
|
||||
|
@ -108,7 +109,7 @@ void test_z_alloc_fd(void)
|
|||
int fd = z_alloc_fd(obj, vtable); /* function being tested */
|
||||
zassert_true(fd >= 0, NULL);
|
||||
|
||||
obj = z_get_fd_obj_and_vtable(fd, &vtable);
|
||||
obj = z_get_fd_obj_and_vtable(fd, &vtable, NULL);
|
||||
|
||||
zassert_equal_ptr(obj, NULL, "obj is different after allocating");
|
||||
zassert_equal_ptr(vtable, NULL, "vtable is different after allocating");
|
||||
|
@ -125,7 +126,7 @@ void test_z_free_fd(void)
|
|||
|
||||
z_free_fd(fd); /* function being tested */
|
||||
|
||||
int *obj = z_get_fd_obj_and_vtable(fd, &vtable);
|
||||
int *obj = z_get_fd_obj_and_vtable(fd, &vtable, NULL);
|
||||
|
||||
zassert_equal_ptr(obj, NULL, "obj is not NULL after freeing");
|
||||
}
|
||||
|
@ -136,14 +137,14 @@ static void test_cb(void *fd_ptr)
|
|||
const struct fd_op_vtable *vtable;
|
||||
int *obj;
|
||||
|
||||
obj = z_get_fd_obj_and_vtable(fd, &vtable);
|
||||
obj = z_get_fd_obj_and_vtable(fd, &vtable, NULL);
|
||||
|
||||
zassert_not_null(obj, "obj is null");
|
||||
zassert_not_null(vtable, "vtable is null");
|
||||
|
||||
z_free_fd(fd);
|
||||
|
||||
obj = z_get_fd_obj_and_vtable(fd, &vtable);
|
||||
obj = z_get_fd_obj_and_vtable(fd, &vtable, NULL);
|
||||
zassert_is_null(obj, "obj is still there");
|
||||
zassert_equal(errno, EBADF, "fd was found");
|
||||
}
|
||||
|
@ -167,7 +168,7 @@ void test_z_fd_multiple_access(void)
|
|||
k_thread_join(&fd_thread, K_FOREVER);
|
||||
|
||||
/* should be null since freed in the other thread */
|
||||
obj = z_get_fd_obj_and_vtable(shared_fd, &vtable);
|
||||
obj = z_get_fd_obj_and_vtable(shared_fd, &vtable, NULL);
|
||||
zassert_is_null(obj, "obj is still there");
|
||||
zassert_equal(errno, EBADF, "fd was found");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue