Skip to content

Commit 7a649cb

Browse files
committed
Add tests for ioctl with comments
1 parent 14e7b9c commit 7a649cb

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

test/sys/test_ioctl.rs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,60 @@ ioctl!(write_buf writebuf_test_u32 with 0, 0; u32);
2222
ioctl!(write_buf writebuf_test_u64 with 0, 0; u64);
2323
ioctl!(readwrite_buf readwritebuf_test with 0, 0; u32);
2424

25+
// Make sure documentation works
26+
ioctl! {
27+
/// This documents the ioctl function
28+
bad none do_bad_docs with 0x1234
29+
}
30+
ioctl! {
31+
/// This documents the ioctl function
32+
bad read do_bad_read_docs with 0x1234; u16
33+
}
34+
ioctl! {
35+
/// This documents the ioctl function
36+
bad write_int do_bad_write_int_docs with 0x1234
37+
}
38+
ioctl! {
39+
/// This documents the ioctl function
40+
bad write_ptr do_bad_write_ptr_docs with 0x1234; u8
41+
}
42+
ioctl! {
43+
/// This documents the ioctl function
44+
bad readwrite do_bad_readwrite_docs with 0x1234; u32
45+
}
46+
ioctl! {
47+
/// This documents the ioctl function
48+
none do_none_docs with 0, 0
49+
}
50+
ioctl! {
51+
/// This documents the ioctl function
52+
read do_read_docs with 0, 0; u32
53+
}
54+
ioctl! {
55+
/// This documents the ioctl function
56+
write_int do_write_int_docs with 0, 0
57+
}
58+
ioctl! {
59+
/// This documents the ioctl function
60+
write_ptr do_write_ptr_docs with 0, 0; u32
61+
}
62+
ioctl! {
63+
/// This documents the ioctl function
64+
readwrite do_readwrite_docs with 0, 0; u32
65+
}
66+
ioctl! {
67+
/// This documents the ioctl function
68+
read_buf do_read_buf_docs with 0, 0; u32
69+
}
70+
ioctl! {
71+
/// This documents the ioctl function
72+
write_buf do_write_buf_docs with 0, 0; u32
73+
}
74+
ioctl! {
75+
/// This documents the ioctl function
76+
readwrite_buf do_readwrite_buf_docs with 0, 0; u32
77+
}
78+
2579
// See C code for source of values for op calculations (does NOT work for mips/powerpc):
2680
// https://gist.github.com/posborne/83ea6880770a1aef332e
2781
//

0 commit comments

Comments
 (0)