summaryrefslogtreecommitdiff
path: root/unit/test-avdtp.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-12-18 16:25:12 +0200
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2013-12-23 10:59:44 +0200
commitda08bafe18b613033e778a2e39d9a784ebedb9e0 (patch)
tree90d98587cf78a30fe91ff99d8971bb1f502e7637 /unit/test-avdtp.c
parent70ab680d2f4f5ae447c171ee459b2467c7d794ef (diff)
downloadbluez-da08bafe18b613033e778a2e39d9a784ebedb9e0.tar.gz
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.
Diffstat (limited to 'unit/test-avdtp.c')
-rw-r--r--unit/test-avdtp.c17
1 files changed, 16 insertions, 1 deletions
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();
}