tests: make the devpath check less strict
authorBartosz Golaszewski <bartekgola@gmail.com>
Tue, 14 Nov 2017 12:37:01 +0000 (13:37 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Tue, 14 Nov 2017 13:13:52 +0000 (14:13 +0100)
commit3a3d69137b4c2fdcbcfe89ed55ea0c15dd0d7573
tree773db2393f64612550c76ad1df2a21b81c468308
parentf4c15c32ac3b87e1c41534735d91f0f65165bf7e
tests: make the devpath check less strict

We plan to change the way gpio-mockup platform devices are registered
in the kernel. This change will add an ID to the gpio-mockup platform
device name and will result in the devpath being changed to
'/devices/platform/gpio-mockup.X/gpiochip'.

When checking the devpath during the test case setup, it's enough to
verify that we got an event from the correct platform device - we
don't need to check the gpiochip name. Shorten the string against
which we check to skip whatever comes after the platform device name.

While we're at it: move the string definition into the function which
is the only user.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
tests/gpiod-test.c