[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGUJoClUZpL71Jw4@google.com>
Date: Wed, 17 May 2023 10:06:40 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Dana Elfassy <delfassy@...hat.com>
Cc: eballetb@...hat.com, javierm@...hat.com,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
Dana Elfassy <dangel101@...il.com>
Subject: Re: [PATCH v2] Input: tests: add test to cover all
input_grab_device() function
Hi Dana,
On Wed, May 17, 2023 at 06:31:45PM +0300, Dana Elfassy wrote:
> Currently input_grab_device() isn't covered by any tests
> Thus, adding a test to cover the cases:
> 1. The device is grabbed successfully
> 2. Trying to grab a device that is already grabbed by another input
> handle
>
> Signed-off-by: Dana Elfassy <dangel101@...il.com>
> Tested-by: Javier Martinez Canillas <javierm@...hat.com>
> Reviewed-by: Javier Martinez Canillas <javierm@...hat.com>
> ---
>
> Changes in v2:
> - Use input_put_device() to decrement the refcount increased by get().
> - Remove unnecessary struct input_handle test_handle variable.
So this tests something different than what patch description states.
You are testing that there is no "recursive" grabbing happening (an API
could be designed to allow the same handle grab device several times).
This is a good and useful test, but you do want to also use 2nd separate
handle to see that it gets -EBUSY as well. And ideally we should have
another test verifying that the 2nd handle can successfully grab the
device once the first handle releases it.
Thanks.
--
Dmitry
Powered by blists - more mailing lists