diff options
author | Jaganath Kanakkassery <jaganath.k@samsung.com> | 2012-05-04 15:27:06 +0530 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-12-04 22:22:06 +0100 |
commit | 889a1a14004932cc49fa4f12e06acf01bf28ff2e (patch) | |
tree | 8d217303ef48fd65350b3a17ca9e6320e3fc66d7 /unit/test-gobex-transfer.c | |
parent | 9095deb82572112fc0870095bf2222964610eafe (diff) | |
download | bluez-889a1a14004932cc49fa4f12e06acf01bf28ff2e.tar.gz |
gobex: Remove g_idle_add to exit main loop in test_stream_put_req_abort()
A callback is provided in g_obex_cancel_transfer() which will be called
when abort completes which exists the mail loop as well
Diffstat (limited to 'unit/test-gobex-transfer.c')
-rw-r--r-- | unit/test-gobex-transfer.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/unit/test-gobex-transfer.c b/unit/test-gobex-transfer.c index 85ba6fa34..2f0578495 100644 --- a/unit/test-gobex-transfer.c +++ b/unit/test-gobex-transfer.c @@ -456,12 +456,8 @@ static gboolean cancel_transfer(gpointer user_data) { struct test_data *d = user_data; - if (d->id > 0) { - g_obex_cancel_transfer(d->id); - d->id = 0; - g_idle_add(cancel_transfer, user_data); - } else - g_main_loop_quit(d->mainloop); + if (d->id > 0) + g_obex_cancel_transfer(d->id, transfer_complete, user_data); return FALSE; } @@ -509,7 +505,7 @@ static void test_stream_put_req_abort(void) g_source_remove(io_id); g_obex_unref(obex); - g_assert_no_error(d.err); + g_assert_error(d.err, G_OBEX_ERROR, G_OBEX_ERROR_CANCELLED); } static void test_stream_put_rsp_abort(void) |