[gbinder-radio] Added radio_request_user_data(). JB#58006

This commit is contained in:
Slava Monich
2022-08-31 14:29:45 +03:00
parent f4276f8602
commit 8fa78cc777
3 changed files with 13 additions and 0 deletions

View File

@@ -207,6 +207,10 @@ radio_request_set_retry_func(
RadioRequest* req,
RadioRequestRetryFunc retry);
void*
radio_request_user_data(
RadioRequest* req); /* Since 1.4.11 */
G_END_DECLS
#endif /* RADIO_REQUEST_H */

View File

@@ -366,6 +366,13 @@ radio_request_drop(
}
}
void*
radio_request_user_data(
RadioRequest* req) /* Since 1.4.11 */
{
return G_LIKELY(req) ? req->user_data : NULL;
}
/*
* Local Variables:
* mode: C

View File

@@ -491,6 +491,7 @@ test_null(
g_assert(!radio_request_ref(NULL));
g_assert(!radio_request_submit(NULL));
g_assert(!radio_request_retry(NULL));
g_assert(!radio_request_user_data(NULL));
radio_request_group_cancel(NULL);
radio_request_group_unref(NULL);
@@ -548,6 +549,7 @@ test_basic(
/* Make sure destroy (but not completion) callback is invoked */
req = radio_request_new(client, RADIO_REQ_GET_MUTE, &args,
test_complete_not_reached, test_destroy_once, &destroyed);
g_assert(radio_request_user_data(req) == &destroyed);
radio_request_unref(req);
g_assert(destroyed);