From eab583b4112606f382ec302d4601770f9c58742d Mon Sep 17 00:00:00 2001 From: Paul Osborne Date: Wed, 12 Aug 2015 19:49:18 -0500 Subject: 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 --- test/sys/test_ioctl.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test/sys') 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 -- cgit v1.2.3