linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH obexd 3/3] gobex: Remove g_idle_add to exit main loop in test_stream_put_req_abort()
@ 2012-04-30 11:04 Jaganath Kanakkassery
  0 siblings, 0 replies; only message in thread
From: Jaganath Kanakkassery @ 2012-04-30 11:04 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jaganath Kanakkassery

A callback is provided in g_obex_cancel_transfer() which will be called
when abort completes which exists the mail loop as well
---
 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 85ba6fa..2f05784 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)
-- 
1.7.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-04-30 11:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-30 11:04 [PATCH obexd 3/3] gobex: Remove g_idle_add to exit main loop in test_stream_put_req_abort() Jaganath Kanakkassery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).