diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-11-29 14:59:01 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-12-05 12:36:03 +0200 |
commit | 0a3a6339df1a564ddc844ec58589f4e2420e578e (patch) | |
tree | b4884aaca96b66fa12f98ca339f8ee06d6d7936e /unit/test-avdtp.c | |
parent | 9ae3077829bffb31b0dd240422a6391d286c1409 (diff) | |
download | bluez-0a3a6339df1a564ddc844ec58589f4e2420e578e.tar.gz |
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.
Diffstat (limited to 'unit/test-avdtp.c')
-rw-r--r-- | unit/test-avdtp.c | 30 |
1 files changed, 29 insertions, 1 deletions
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(); } |