From da08bafe18b613033e778a2e39d9a784ebedb9e0 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 18 Dec 2013 16:25:12 +0200 Subject: [PATCH] unit/AVDTP: Add /TP/SIG/SYN/BV-03-C test Verify that an initial delay report is sent by a SNK (ACP) device when the Stream Configuration Procedure is initiated by the SRC device (transition from IDLE to OPEN state) and that the report conforms to the specification. --- unit/test-avdtp.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/unit/test-avdtp.c b/unit/test-avdtp.c index 0751a049b..a06549596 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(); } -- 2.47.3