Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a broken test to simulate libinputs sys-path and device path validation #49

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

APokorny
Copy link

@APokorny APokorny commented Oct 9, 2015

When libinput is asked to open a device via path it opens the device
directly but also tries to achieve the same by evaluating major minor
from fstat(fd).st_rdev and opening the resulting
/sys/dev/type/major:mior path. The information returned by fstat does
currently not match the stat data received directly from the path.

I tried to get this working without needing the file, but failed to setup the umockdev device properly.
With the given test it bails out, just like libinput would:

ERROR:tests/test-umockdev.c:302:t_testbed_add_devicev_fstat: assertion failed (stat_from_stat.st_rdev == stat_from_fstat.st_rdev): (3398 == 34850)

When libinput is asked to open a device via path it opens the device
directly but also tries to achieve the same by evaluating major minor
from fstat(fd).st_rdev and opening the resulting
/sys/dev/type/major:mior path. The information returned by fstat does
currently not match the stat data received directly from the path.
@alfredopalhares
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants