From: Jaganath Kanakkassery <jaganath.k@samsung.com>
To: linux-bluetooth@vger.kernel.org
Cc: Jaganath Kanakkassery <jaganath.k@samsung.com>
Subject: [PATCH obexd v2 3/3] gobex: Remove g_idle_add to exit main loop in test_stream_put_req_abort()
Date: Fri, 04 May 2012 15:27:06 +0530 [thread overview]
Message-ID: <1336125426-30445-3-git-send-email-jaganath.k@samsung.com> (raw)
In-Reply-To: <1336125426-30445-1-git-send-email-jaganath.k@samsung.com>
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
next prev parent reply other threads:[~2012-05-04 9:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-04 9:57 [PATCH obexd v2 1/3] gobex: Add callback and userdata parameter to g_obex_cancel_transfer() Jaganath Kanakkassery
2012-05-04 9:57 ` [PATCH obexd v2 2/3] client: Wait for abort completion before Transfer.Cancel returns Jaganath Kanakkassery
2012-05-04 9:57 ` Jaganath Kanakkassery [this message]
2012-05-04 14:05 ` [PATCH obexd v2 1/3] gobex: Add callback and userdata parameter to g_obex_cancel_transfer() Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336125426-30445-3-git-send-email-jaganath.k@samsung.com \
--to=jaganath.k@samsung.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).