tests: provide and use gpiod_test_chip_watch_line_info_or_fail()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 7 Apr 2023 14:32:22 +0000 (16:32 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 7 Apr 2023 14:32:22 +0000 (16:32 +0200)
commita5cf1d6164c8a338f758f84c97a5d0b084ca6262
tree6d00fba10878eb411f907b854369ad883cdbdd2d
parent318db06b5f5e93a1543ce75ce42ab300c7dad01a
tests: provide and use gpiod_test_chip_watch_line_info_or_fail()

We can shrink the code a bit by wrapping the call to
gpiod_chip_watch_line_info() and the subsequent checks in a helper macro.
This also fixes a potential null-pointer dereference in one of the info
event test cases.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
tests/gpiod-test-helpers.h
tests/tests-info-event.c