public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Sandeep Patil <sspatil@google.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] input/input06: Ignore auto-repeat config events
Date: Mon, 14 Aug 2017 16:32:05 -0700	[thread overview]
Message-ID: <20170814233205.10933-1-sspatil@google.com> (raw)

The test currently fails on some android devices because the kernel
sends the EV_REP event with the codes REP_DELAY and REP_PERIOD and
their corresponding values for the uinput device the test creates.

This results in incorrect test failure as follows:

 input06     0  TINFO  :  Didn't receive EV_KEY KEY_X with value 2
 input06     1  TFAIL  :  external/ltp/testcases/kernel/input/input06.c:64: Wrong data received in
                         eventX

Signed-off-by: Sandeep Patil <sspatil@google.com>
---
 testcases/kernel/input/input06.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/testcases/kernel/input/input06.c b/testcases/kernel/input/input06.c
index c4fc1ef57..8d04db8c6 100644
--- a/testcases/kernel/input/input06.c
+++ b/testcases/kernel/input/input06.c
@@ -137,12 +137,26 @@ static int check_events(void)
 
 	check_size(rd);
 
+	/*
+	 * Ignore auto-repeat configuration codes
+	 * (EV_REP, {REP_PERIOD, REP_TYPE), value)
+	 */
+	while (iev[i].type == EV_REP) {
+		i++;
+		if (i == rd / sizeof(struct input_event)) {
+			i = 0;
+			rd = read(fd2, iev, sizeof(iev));
+			check_size(rd);
+		}
+	}
+
 	if (rd > 0 && check_event(&iev[i], EV_KEY, KEY_X, 1))
 		i++;
 
 	while (check_bound(i, rd) && !check_event(&iev[i], EV_KEY, KEY_X, 0)) {
 
 		if (iev[i].type != EV_SYN
+			&& iev[i].type != EV_REP
 			&& !check_event(&iev[i], EV_KEY, KEY_X, 2)) {
 			tst_resm(TINFO,
 				"Didn't receive EV_KEY KEY_X with value 2");
-- 
2.14.0.434.g98096fd7a8-goog


             reply	other threads:[~2017-08-14 23:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14 23:32 Sandeep Patil [this message]
2017-08-21 19:59 ` [LTP] [PATCH] input/input06: Ignore auto-repeat config events Sandeep Patil
2017-08-22  8:53 ` Cyril Hrubis
2017-08-22 17:00   ` Sandeep Patil

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=20170814233205.10933-1-sspatil@google.com \
    --to=sspatil@google.com \
    --cc=ltp@lists.linux.it \
    /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