Skip to content

Commit a6a5cc8

Browse files
authored
Add some tests for the module functions. (#1029)
1 parent 7b44528 commit a6a5cc8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/system/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#![cfg(feature = "system")]
44
#![cfg(not(any(windows, target_os = "wasi")))]
55

6+
#[cfg(linux_kernel)]
7+
mod module;
68
#[cfg(target_os = "linux")]
79
mod reboot;
810
#[cfg(linux_kernel)]

tests/system/module.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[cfg(feature = "fs")]
2+
#[test]
3+
fn test_kernel_module() {
4+
use rustix::cstr;
5+
use rustix::system::*;
6+
7+
let _ = init_module(&[], cstr!(""));
8+
let _ = finit_module(rustix::fs::CWD, cstr!(""), 0);
9+
let _ = delete_module(cstr!(""), 0);
10+
}

0 commit comments

Comments
 (0)