From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 7/8] unit/test-uhid: Add /uhid/event/output test
Date: Wed, 21 May 2014 18:01:08 +0300 [thread overview]
Message-ID: <1400684469-2693-7-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1400684469-2693-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
unit/test-uhid.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/unit/test-uhid.c b/unit/test-uhid.c
index cb9b05a..a8aba9b 100644
--- a/unit/test-uhid.c
+++ b/unit/test-uhid.c
@@ -239,6 +239,10 @@ static const struct uhid_event ev_input = {
.type = UHID_INPUT,
};
+static const struct uhid_event ev_output = {
+ .type = UHID_OUTPUT,
+};
+
static void test_client(gconstpointer data)
{
struct context *context = create_context(data);
@@ -259,6 +263,24 @@ static void test_client(gconstpointer data)
execute_context(context);
}
+static void handle_output(struct uhid_event *ev, void *user_data)
+{
+ g_assert_cmpint(ev->type, ==, UHID_OUTPUT);
+
+ context_quit(user_data);
+}
+
+static void test_server(gconstpointer data)
+{
+ struct context *context = create_context(data);
+
+ bt_uhid_register(context->uhid, UHID_OUTPUT, handle_output, context);
+
+ g_idle_add(send_pdu, context);
+
+ execute_context(context);
+}
+
int main(int argc, char *argv[])
{
g_test_init(&argc, &argv, NULL);
@@ -269,5 +291,7 @@ int main(int argc, char *argv[])
event(&ev_feature_answer));
define_test("/uhid/command/input", test_client, event(&ev_input));
+ define_test("/uhid/event/output", test_server, event(&ev_output));
+
return g_test_run();
}
--
1.9.0
next prev parent reply other threads:[~2014-05-21 15:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-21 15:01 [PATCH BlueZ 1/8] shared/uhid: Add initial API Luiz Augusto von Dentz
2014-05-21 15:01 ` [PATCH BlueZ 2/8] unit/test-uhid: Add /uhid/command/create test Luiz Augusto von Dentz
2014-05-21 15:01 ` [PATCH BlueZ 3/8] unit/test-uhid: Add /uhid/command/destroy test Luiz Augusto von Dentz
2014-05-21 15:01 ` [PATCH BlueZ 4/8] unit/test-uhid: Add /uhid/command/feature_answer test Luiz Augusto von Dentz
2014-05-21 15:01 ` [PATCH BlueZ 5/8] unit/test-uhid: Add /uhid/command/input test Luiz Augusto von Dentz
2014-05-21 15:01 ` [PATCH BlueZ 6/8] shared/uhid: Add implemetation of bt_uhid_register/bt_uhid_unregister Luiz Augusto von Dentz
2014-05-21 15:01 ` Luiz Augusto von Dentz [this message]
2014-05-21 15:01 ` [PATCH BlueZ 8/8] unit/test-uhid: Add /uhid/event/feature test Luiz Augusto von Dentz
2014-05-23 13:51 ` [PATCH BlueZ 1/8] shared/uhid: Add initial API Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400684469-2693-7-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).