[PATCH v2 05/20] unit/AVDTP: Add /TP/SIG/SMG/BV-07-C test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

Verify that the IUT (INT) is able to issue a valid query for remote SEP
capabilities and reports the replied ones.
---
 unit/test-avdtp.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/unit/test-avdtp.c b/unit/test-avdtp.c
index 5623153..81155a4 100644
--- a/unit/test-avdtp.c
+++ b/unit/test-avdtp.c
@@ -198,11 +198,12 @@ static void execute_context(struct context *context)
 static void test_server(gconstpointer data)
 {
 	const struct test_data *test = data;
-	struct context *context = create_context();
+	struct context *context = create_context(0x0100);
 
 	context->pdu_list = test->pdu_list;
+
 	avdtp_register_sep(AVDTP_SEP_TYPE_SOURCE, AVDTP_MEDIA_TYPE_AUDIO, 0x00,
-				TRUE, NULL, NULL, NULL);
+							TRUE, NULL, NULL, NULL);
 
 	g_idle_add(send_pdu, context);
 
@@ -230,6 +231,20 @@ static void test_discover(gconstpointer data)
 	g_free(test->pdu_list);
 }
 
+static void test_get_capabilities(gconstpointer data)
+{
+	const struct test_data *test = data;
+	struct context *context = create_context(0x0100);
+
+	context->pdu_list = test->pdu_list;
+
+	avdtp_discover(context->session, discover_cb, NULL);
+
+	execute_context(context);
+
+	g_free(test->pdu_list);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -248,6 +263,10 @@ int main(int argc, char *argv[])
 	define_test("/TP/SIG/SMG/BV-06-C", test_server,
 			raw_pdu(0x00, 0x01),
 			raw_pdu(0x02, 0x01, 0x04, 0x00));
+	define_test("/TP/SIG/SMG/BV-07-C", test_get_capabilities,
+			raw_pdu(0x10, 0x01),
+			raw_pdu(0x12, 0x01, 0x04, 0x00),
+			raw_pdu(0x20, 0x02, 0x04));
 
 	return g_test_run();
 }
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux