tests: fix a potential assert() abort()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Sun, 19 Feb 2023 20:39:03 +0000 (21:39 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Sun, 19 Feb 2023 20:39:03 +0000 (21:39 +0100)
commit8e3ca35d122a4f8a2636b8bb07fec93443895a4d
tree9bf0d01bbd7b33ee2050313e5857674da6b37761
parent96534002eff8d3cc9c823886fdff1487ccbafc92
tests: fix a potential assert() abort()

If info is NULL in one of the line-info test cases, we'll still try to
read its property leading to an abort() triggered from assert(info). Just
bail out of the test function if gpiod_chip_get_line_info() fails.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
tests/tests-line-info.c