Skip to content

Commit

Permalink
Add tests for ioctl with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
roblabla committed Jul 21, 2017
1 parent 14e7b9c commit 7a649cb
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions test/sys/test_ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,60 @@ ioctl!(write_buf writebuf_test_u32 with 0, 0; u32);
ioctl!(write_buf writebuf_test_u64 with 0, 0; u64);
ioctl!(readwrite_buf readwritebuf_test with 0, 0; u32);

// Make sure documentation works
ioctl! {
/// This documents the ioctl function
bad none do_bad_docs with 0x1234
}
ioctl! {
/// This documents the ioctl function
bad read do_bad_read_docs with 0x1234; u16
}
ioctl! {
/// This documents the ioctl function
bad write_int do_bad_write_int_docs with 0x1234
}
ioctl! {
/// This documents the ioctl function
bad write_ptr do_bad_write_ptr_docs with 0x1234; u8
}
ioctl! {
/// This documents the ioctl function
bad readwrite do_bad_readwrite_docs with 0x1234; u32
}
ioctl! {
/// This documents the ioctl function
none do_none_docs with 0, 0
}
ioctl! {
/// This documents the ioctl function
read do_read_docs with 0, 0; u32
}
ioctl! {
/// This documents the ioctl function
write_int do_write_int_docs with 0, 0
}
ioctl! {
/// This documents the ioctl function
write_ptr do_write_ptr_docs with 0, 0; u32
}
ioctl! {
/// This documents the ioctl function
readwrite do_readwrite_docs with 0, 0; u32
}
ioctl! {
/// This documents the ioctl function
read_buf do_read_buf_docs with 0, 0; u32
}
ioctl! {
/// This documents the ioctl function
write_buf do_write_buf_docs with 0, 0; u32
}
ioctl! {
/// This documents the ioctl function
readwrite_buf do_readwrite_buf_docs with 0, 0; u32
}

// See C code for source of values for op calculations (does NOT work for mips/powerpc):
// https://gist.github.com/posborne/83ea6880770a1aef332e
//
Expand Down

0 comments on commit 7a649cb

Please sign in to comment.