From 0a3a6339df1a564ddc844ec58589f4e2420e578e Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 29 Nov 2013 14:59:01 +0200 Subject: [PATCH] unit/AVDTP: Add /TP/SIG/SMG/BI-10-C test Verify that the IUT (ACP) is able to issue a get configuration reject response to the INT. --- unit/test-avdtp.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/unit/test-avdtp.c b/unit/test-avdtp.c index 149583046..8aee50c31 100644 --- a/unit/test-avdtp.c +++ b/unit/test-avdtp.c @@ -315,7 +315,8 @@ static void sep_setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep, g_assert(err == NULL); - if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-11-C")) + if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-11-C") || + g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-10-C")) ret = avdtp_get_configuration(session, stream); else if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BV-23-C")) ret = avdtp_abort(session, stream); @@ -325,6 +326,21 @@ static void sep_setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep, g_assert_cmpint(ret, ==, 0); } +static void sep_getconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep, + struct avdtp_stream *stream, + struct avdtp_error *err, void *user_data) +{ + struct context *context = user_data; + + if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-10-C")) { + g_assert(err != NULL); + g_assert_cmpint(avdtp_error_error_code(err), ==, 0x12); + } else + g_assert(err == NULL); + + context_quit(context); +} + static void sep_open_cfm(struct avdtp *session, struct avdtp_local_sep *sep, struct avdtp_stream *stream, struct avdtp_error *err, void *user_data) @@ -358,6 +374,7 @@ static void sep_start_cfm(struct avdtp *session, struct avdtp_local_sep *sep, static struct avdtp_sep_cfm sep_cfm = { .set_configuration = sep_setconf_cfm, + .get_configuration = sep_getconf_cfm, .open = sep_open_cfm, .start = sep_start_cfm, }; @@ -774,6 +791,17 @@ int main(int argc, char *argv[]) raw_pdu(0x20, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00, 0x21, 0x02, 0x02, 0x20), raw_pdu(0x23, 0x03, 0x00, 0x29)); + define_test("/TP/SIG/SMG/BI-10-C", test_client, + raw_pdu(0x10, 0x01), + raw_pdu(0x12, 0x01, 0x04, 0x00), + raw_pdu(0x20, 0x02, 0x04), + raw_pdu(0x22, 0x02, 0x01, 0x00, 0x07, 0x06, 0x00, 0x00, + 0xff, 0xff, 0x02, 0x40), + raw_pdu(0x30, 0x03, 0x04, 0x04, 0x01, 0x00, 0x07, 0x06, + 0x00, 0x00, 0x21, 0x02, 0x02, 0x20), + raw_pdu(0x32, 0x03), + raw_pdu(0x40, 0x04, 0x04), + raw_pdu(0x43, 0x04, 0x12)); return g_test_run(); } -- 2.47.3