[PATCH obexd 3/3] gobex: Remove g_idle_add to exit main loop in test_stream_put_req_abort()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux