From 8c923a75c89ef54976205054eafaec8a79f83ffd Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 8 Oct 2014 14:29:33 +0300 Subject: [PATCH] unit/test-avrcp: Add /TP/MPS/BI-02-C test Verify the SetBrowsedPlayer response issued by the TG when an invalid player is requested. --- unit/test-avrcp.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c index 90a9149ab..40d2cf98d 100644 --- a/unit/test-avrcp.c +++ b/unit/test-avrcp.c @@ -607,13 +607,19 @@ static int set_addressed(struct avrcp *session, uint8_t transaction, static int set_browsed(struct avrcp *session, uint8_t transaction, uint16_t id, void *user_data) { + struct context *context = user_data; const char *folders[1] = { "Filesystem" }; DBG(""); - avrcp_set_browsed_player_rsp(session, transaction, - AVRCP_STATUS_SUCCESS, 0xabcd, 0, 1, - folders); + if (g_str_equal(context->data->test_name, "/TP/MPS/BI-02-C")) + avrcp_set_browsed_player_rsp(session, transaction, + AVRCP_STATUS_INVALID_PLAYER_ID, + 0, 0, 0, NULL); + else + avrcp_set_browsed_player_rsp(session, transaction, + AVRCP_STATUS_SUCCESS, + 0xabcd, 0, 1, folders); return -EAGAIN; } @@ -991,6 +997,13 @@ int main(int argc, char *argv[]) AVRCP_SET_ADDRESSED_PLAYER, 0x00, 0x00, 0x01, 0x11)); + /* SetBrowsedPlayer - TG */ + define_test("/TP/MPS/BI-02-C", test_server, + brs_pdu(0x00, 0x11, 0x0e, 0x70, 0x00, 0x02, + 0xab, 0xcd), + brs_pdu(0x02, 0x11, 0x0e, 0x70, 0x00, 0x01, + 0x11)); + /* * Media Content Navigation Commands and Notifications for Content * Browsing. -- 2.47.3