From accd43d05b786c9a9723ec29b6bb5271d10d9328 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 8 Oct 2014 14:50:21 +0300 Subject: [PATCH] unit/test-avrcp: Fix not checking PDU type It is an error if a control PDU is received over browsing channel or vice versa. --- unit/test-avrcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c index 88d23f0d7..92c34206d 100644 --- a/unit/test-avrcp.c +++ b/unit/test-avrcp.c @@ -189,6 +189,8 @@ static gboolean test_handler(GIOChannel *channel, GIOCondition cond, pdu = &context->data->pdu_list[context->pdu_offset++]; + g_assert(!pdu->browse); + if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) { context->source = 0; g_print("%s: cond %x\n", __func__, cond); @@ -228,6 +230,8 @@ static gboolean browse_test_handler(GIOChannel *channel, GIOCondition cond, pdu = &context->data->pdu_list[context->pdu_offset++]; + g_assert(pdu->browse); + if (cond & (G_IO_NVAL | G_IO_ERR | G_IO_HUP)) { context->browse_source = 0; g_print("%s: cond %x\n", __func__, cond); -- 2.47.3