diff options
author | Paul Osborne <Paul.Osborne@digi.com> | 2015-08-12 19:49:18 -0500 |
---|---|---|
committer | Paul Osborne <Paul.Osborne@digi.com> | 2015-08-12 19:49:18 -0500 |
commit | eab583b4112606f382ec302d4601770f9c58742d (patch) | |
tree | b5c2cedf72790ca686b150693285cc7472e4a3c9 /test/sys | |
parent | 1ed5a9b997e75783baa45a041c462f9aeb069ce8 (diff) | |
download | nix-eab583b4112606f382ec302d4601770f9c58742d.zip |
ioctl: return result type rather than raw integer
This change also adds macro usages in the tests. Nothing is asserted
but the use of the macros provides a basic compile-time check that
is otherwise missing.
Signed-off-by: Paul Osborne <osbpau@gmail.com>
Diffstat (limited to 'test/sys')
-rw-r--r-- | test/sys/test_ioctl.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/sys/test_ioctl.rs b/test/sys/test_ioctl.rs index 90de9d87..94eca447 100644 --- a/test/sys/test_ioctl.rs +++ b/test/sys/test_ioctl.rs @@ -1,5 +1,16 @@ +#![allow(dead_code)] + #![cfg(target_os = "linux")] // no ioctl support for osx yet -use nix::sys::ioctl::*; + +// Simple tests to ensure macro generated fns compile +ioctl!(bad do_bad with 0x1234); +ioctl!(none do_none with 0, 0); +ioctl!(read read_test with 0, 0; u32); +ioctl!(write write_test with 0, 0; u64); +ioctl!(readwrite readwrite_test with 0, 0; u64); +ioctl!(read buf readbuf_test with 0, 0; u32); +ioctl!(write buf writebuf_test with 0, 0; u32); +ioctl!(readwrite buf readwritebuf_test with 0, 0; u32); // See C code for source of values for op calculations: // https://gist.github.com/posborne/83ea6880770a1aef332e |