* [PATCH 1/3] unit/avrcp: Refactor tests to use destroy_context()
@ 2014-02-24 13:25 Andrei Emeltchenko
2014-02-24 13:25 ` [PATCH 2/3] unit/avrcp: Add /TP/PTT/BV-01-I test Andrei Emeltchenko
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andrei Emeltchenko @ 2014-02-24 13:25 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
unit/test-avrcp.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c
index 381e7cb..e9fe7e3 100644
--- a/unit/test-avrcp.c
+++ b/unit/test-avrcp.c
@@ -246,15 +246,7 @@ static void execute_context(struct context *context)
{
g_main_loop_run(context->main_loop);
- if (context->source > 0)
- g_source_remove(context->source);
-
- avrcp_shutdown(context->session);
-
- g_main_loop_unref(context->main_loop);
-
- test_free(context->data);
- g_free(context);
+ destroy_context(context);
}
static void test_server(gconstpointer data)
--
1.8.3.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/3] unit/avrcp: Add /TP/PTT/BV-01-I test 2014-02-24 13:25 [PATCH 1/3] unit/avrcp: Refactor tests to use destroy_context() Andrei Emeltchenko @ 2014-02-24 13:25 ` Andrei Emeltchenko 2014-02-24 13:25 ` [PATCH 3/3] android/avctp: Set uinput to invalid fd when creating session Andrei Emeltchenko 2014-02-24 16:17 ` [PATCH 1/3] unit/avrcp: Refactor tests to use destroy_context() Luiz Augusto von Dentz 2 siblings, 0 replies; 4+ messages in thread From: Andrei Emeltchenko @ 2014-02-24 13:25 UTC (permalink / raw) To: linux-bluetooth From: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Test verifies that the Target reacts to the PASS THROUGH command in category 1 from the Controller. The command chosen is PLAY (0x44). --- unit/test-avrcp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c index e9fe7e3..9d2e56a 100644 --- a/unit/test-avrcp.c +++ b/unit/test-avrcp.c @@ -291,5 +291,11 @@ int main(int argc, char *argv[]) raw_pdu(0x02, 0x11, 0x0e, 0x0c, 0xf8, 0x31, 0x07, 0x48, 0xff, 0xff, 0xff)); + define_test("/TP/PTT/BV-01-I", test_server, + raw_pdu(0x00, 0x11, 0x0e, 0x00, 0x48, 0x7c, + 0x44, 0x00), + raw_pdu(0x02, 0x11, 0x0e, 0x09, 0x48, 0x7c, + 0x44, 0x00)); + return g_test_run(); } -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] android/avctp: Set uinput to invalid fd when creating session 2014-02-24 13:25 [PATCH 1/3] unit/avrcp: Refactor tests to use destroy_context() Andrei Emeltchenko 2014-02-24 13:25 ` [PATCH 2/3] unit/avrcp: Add /TP/PTT/BV-01-I test Andrei Emeltchenko @ 2014-02-24 13:25 ` Andrei Emeltchenko 2014-02-24 16:17 ` [PATCH 1/3] unit/avrcp: Refactor tests to use destroy_context() Luiz Augusto von Dentz 2 siblings, 0 replies; 4+ messages in thread From: Andrei Emeltchenko @ 2014-02-24 13:25 UTC (permalink / raw) To: linux-bluetooth From: Andrei Emeltchenko <andrei.emeltchenko@intel.com> When AVCTP session was created uinput was zero which is valid file descriptor and that was conflicting with socketpair() fds. --- android/avctp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/android/avctp.c b/android/avctp.c index 1e414d1..9bfb191 100644 --- a/android/avctp.c +++ b/android/avctp.c @@ -1414,6 +1414,7 @@ struct avctp *avctp_new(int fd, size_t imtu, size_t omtu, uint16_t version) return NULL; } + session->uinput = -1; session->control = control; session->passthrough_id = avctp_register_pdu_handler(session, AVC_OP_PASSTHROUGH, -- 1.8.3.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] unit/avrcp: Refactor tests to use destroy_context() 2014-02-24 13:25 [PATCH 1/3] unit/avrcp: Refactor tests to use destroy_context() Andrei Emeltchenko 2014-02-24 13:25 ` [PATCH 2/3] unit/avrcp: Add /TP/PTT/BV-01-I test Andrei Emeltchenko 2014-02-24 13:25 ` [PATCH 3/3] android/avctp: Set uinput to invalid fd when creating session Andrei Emeltchenko @ 2014-02-24 16:17 ` Luiz Augusto von Dentz 2 siblings, 0 replies; 4+ messages in thread From: Luiz Augusto von Dentz @ 2014-02-24 16:17 UTC (permalink / raw) To: Andrei Emeltchenko; +Cc: linux-bluetooth@vger.kernel.org Hi Andrei, On Mon, Feb 24, 2014 at 3:25 PM, Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com> wrote: > From: Andrei Emeltchenko <andrei.emeltchenko@intel.com> > > --- > unit/test-avrcp.c | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/unit/test-avrcp.c b/unit/test-avrcp.c > index 381e7cb..e9fe7e3 100644 > --- a/unit/test-avrcp.c > +++ b/unit/test-avrcp.c > @@ -246,15 +246,7 @@ static void execute_context(struct context *context) > { > g_main_loop_run(context->main_loop); > > - if (context->source > 0) > - g_source_remove(context->source); > - > - avrcp_shutdown(context->session); > - > - g_main_loop_unref(context->main_loop); > - > - test_free(context->data); > - g_free(context); > + destroy_context(context); > } > > static void test_server(gconstpointer data) > -- > 1.8.3.2 Pushed with some changes to patch 2/3 to actually add a callback to handle AVC_PLAY. -- Luiz Augusto von Dentz ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-02-24 16:17 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-02-24 13:25 [PATCH 1/3] unit/avrcp: Refactor tests to use destroy_context() Andrei Emeltchenko 2014-02-24 13:25 ` [PATCH 2/3] unit/avrcp: Add /TP/PTT/BV-01-I test Andrei Emeltchenko 2014-02-24 13:25 ` [PATCH 3/3] android/avctp: Set uinput to invalid fd when creating session Andrei Emeltchenko 2014-02-24 16:17 ` [PATCH 1/3] unit/avrcp: Refactor tests to use destroy_context() Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox