[libcamera-devel] [PATCH v3 18/30] py: unittests: Fix test_select()
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Fri May 27 21:09:13 CEST 2022
Hi Tomi,
Thank you for the patch.
On Fri, May 27, 2022 at 05:44:35PM +0300, Tomi Valkeinen wrote:
> The test_select() current uses self.assertTrue(len(ready_reqs) > 0) to
s/current/currently/
> see that cm.get_ready_requests() returns something. This is not always
> the case, as there may be two eventfd events queued, and the first call
> to cm.get_ready_requests() returns all the requests, and thus the second
> call returns none.
>
> Remove the self.assertTrue(len(ready_reqs) > 0) assert.
This convinces me even more that there's room for improvement :-) It
seems a bit confusing for applications.
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> test/py/unittests.py | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/test/py/unittests.py b/test/py/unittests.py
> index 45b35223..33b35a0a 100755
> --- a/test/py/unittests.py
> +++ b/test/py/unittests.py
> @@ -287,8 +287,6 @@ class SimpleCaptureMethods(CameraTesterBase):
>
> ready_reqs = cm.get_ready_requests()
>
> - self.assertTrue(len(ready_reqs) > 0)
> -
> reqs += ready_reqs
>
> if len(reqs) == num_bufs:
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list