-
Notifications
You must be signed in to change notification settings - Fork 670
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests of the generated functions using real ioctl values. These values should be confirmed by the kernel when they're called, so it provides a nice check on both the definition and ergonomics of the generated functions but also the value of the generated ioctl as well. Additionally, change the testing for ioctl number generation to use the same value as that calculated by the C macros. This gets rid of those hard-coded values and simplifies supporting additional platforms, especially ones that no devs have command- line access to.
- Loading branch information
Showing
5 changed files
with
272 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include <sys/ioctl.h> | ||
#include <stdint.h> | ||
|
||
uint64_t io_a_255() { | ||
return _IO('a', 255); | ||
} | ||
|
||
uint64_t io_q_10() { | ||
return _IO('q', 10); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.