Diff between 70ab680d2f4f5ae447c171ee459b2467c7d794ef and da08bafe18b613033e778a2e39d9a784ebedb9e0

Changed Files

File Additions Deletions Status
unit/test-avdtp.c +16 -1 modified

Full Patch

diff --git a/unit/test-avdtp.c b/unit/test-avdtp.c
index 0751a04..a065495 100644
--- a/unit/test-avdtp.c
+++ b/unit/test-avdtp.c
@@ -86,6 +86,7 @@ struct context {
 	struct avdtp_local_sep *sep;
 	struct avdtp_stream *stream;
 	guint source;
+	guint process;
 	int fd;
 	int mtu;
 	gboolean pending_open;
@@ -113,6 +114,9 @@ static gboolean context_quit(gpointer user_data)
 {
 	struct context *context = user_data;
 
+	if (context->process > 0)
+		g_source_remove(context->process);
+
 	g_main_loop_quit(context->main_loop);
 
 	return FALSE;
@@ -149,7 +153,7 @@ static void context_process(struct context *context)
 		return;
 	}
 
-	g_idle_add(send_pdu, context);
+	context->process = g_idle_add(send_pdu, context);
 }
 
 static gboolean transport_open(struct avdtp_stream *stream)
@@ -1270,6 +1274,17 @@ int main(int argc, char *argv[])
 			raw_pdu(0xf0, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
 				0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
 				0x00));
+	define_test("/TP/SIG/SYN/BV-03-C", test_server_1_3_sink,
+			raw_pdu(0x00, 0x01),
+			raw_pdu(0x02, 0x01, 0x04, 0x08),
+			raw_pdu(0x10, 0x0c, 0x04),
+			raw_pdu(0x12, 0x0c, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00,
+				0xff, 0xff, 0x02, 0x40, 0x08, 0x00),
+			raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06,
+				0x00, 0x00, 0x21, 0x02, 0x02, 0x20, 0x08,
+				0x00),
+			raw_pdu(0x22, 0x03),
+			raw_pdu(0x00, 0x0d, 0x04, 0x00, 0x00));
 
 	return g_test_run();
 }