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

👍

@martinpitt martinpitt force-pushed the master branch 2 times, most recently from 4fc5ae4 to 6e9d9f1 Compare November 25, 2020 15:38
@martinpitt martinpitt force-pushed the master branch 4 times, most recently from b0d18da to 5b9b776 Compare December 31, 2020 10:06
@martinpitt martinpitt marked this pull request as draft July 14, 2022 10:17
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