linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/mcaptest: Add missing mainloop quit
@ 2014-10-28 14:42 Grzegorz Kolodziejczyk
  2014-10-30  9:49 ` Szymon Janc
  0 siblings, 1 reply; 2+ messages in thread
From: Grzegorz Kolodziejczyk @ 2014-10-28 14:42 UTC (permalink / raw)
  To: linux-bluetooth

MCAP test should quit from main loop if mcl disconnects or if can't
create mdl, mcl. Tested with PTS 5.3 test cases.
---
 tools/mcaptest.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/mcaptest.c b/tools/mcaptest.c
index 5ef030c..dd638c9 100644
--- a/tools/mcaptest.c
+++ b/tools/mcaptest.c
@@ -151,6 +151,8 @@ static void mcl_disconnected(struct mcap_mcl *mcl, gpointer data)
 {
 	/* TODO */
 	printf("MCL disconnected\n");
+
+	g_main_loop_quit(mloop);
 }
 
 static void mcl_uncached(struct mcap_mcl *mcl, gpointer data)
@@ -174,6 +176,7 @@ static void create_mdl_cb(struct mcap_mdl *mcap_mdl, uint8_t type, GError *gerr,
 	if (gerr) {
 		printf("MDL error: %s\n", gerr->message);
 
+		g_main_loop_quit(mloop);
 		return;
 	}
 
@@ -186,6 +189,8 @@ static void create_mdl_cb(struct mcap_mdl *mcap_mdl, uint8_t type, GError *gerr,
 								NULL, &err)) {
 		printf("Error connecting to mdl: %s\n", err->message);
 		g_error_free(err);
+
+		g_main_loop_quit(mloop);
 	}
 }
 
@@ -255,6 +260,7 @@ static void create_mcl_cb(struct mcap_mcl *mcap_mcl, GError *err, gpointer data)
 	if (err) {
 		printf("Could not connect MCL: %s\n", err->message);
 
+		g_main_loop_quit(mloop);
 		return;
 	}
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-30  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-28 14:42 [PATCH] tools/mcaptest: Add missing mainloop quit Grzegorz Kolodziejczyk
2014-10-30  9:49 ` Szymon Janc

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).