diff --git a/unit/test-gatt.c b/unit/test-gatt.c
index 9fa301b..69654f1 100644
--- a/unit/test-gatt.c
+++ b/unit/test-gatt.c
int fd;
unsigned int pdu_offset;
const struct test_data *data;
+ struct bt_gatt_request *req;
};
#define data(args...) ((const unsigned char[]) { args })
if (context->source > 0)
g_source_remove(context->source);
+ if (context->req)
+ bt_gatt_request_unref(context->req);
+
bt_gatt_client_unref(context->client);
bt_gatt_server_unref(context->server);
gatt_db_unref(context->client_db);
{
struct context *context = user_data;
+ bt_gatt_request_unref(context->req);
+ context->req = NULL;
+
g_assert(success);
context_quit(context);
struct context *context = create_context(512, data);
const struct test_data *test_data = data;
- bt_gatt_discover_all_primary_services(context->att, test_data->uuid,
+ context->req = bt_gatt_discover_all_primary_services(context->att,
+ test_data->uuid,
generic_search_cb,
context, NULL);
}
{
struct context *context = create_context(512, data);
- bt_gatt_discover_included_services(context->att, 0x0001, 0xffff,
+ context->req = bt_gatt_discover_included_services(context->att,
+ 0x0001, 0xffff,
generic_search_cb,
context, NULL);
}
{
struct context *context = create_context(512, data);
- g_assert(bt_gatt_discover_characteristics(context->att, 0x0010, 0x0020,
+ context->req = bt_gatt_discover_characteristics(context->att,
+ 0x0010, 0x0020,
generic_search_cb,
- context, NULL));
+ context, NULL);
+ g_assert(context->req);
}
static void test_search_descs(gconstpointer data)
{
struct context *context = create_context(512, data);
- g_assert(bt_gatt_discover_descriptors(context->att, 0x0013, 0x0016,
+ context->req = bt_gatt_discover_descriptors(context->att,
+ 0x0013, 0x0016,
generic_search_cb,
- context, NULL));
+ context, NULL);
+ g_assert(context->req);
}
static const struct test_step test_read_by_type_1 = {