Skip to content

Commit

Permalink
Add some tests for the module functions. (#1029)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode authored Mar 19, 2024
1 parent 7b44528 commit a6a5cc8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/system/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#![cfg(feature = "system")]
#![cfg(not(any(windows, target_os = "wasi")))]

#[cfg(linux_kernel)]
mod module;
#[cfg(target_os = "linux")]
mod reboot;
#[cfg(linux_kernel)]
Expand Down
10 changes: 10 additions & 0 deletions tests/system/module.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#[cfg(feature = "fs")]
#[test]
fn test_kernel_module() {
use rustix::cstr;
use rustix::system::*;

let _ = init_module(&[], cstr!(""));
let _ = finit_module(rustix::fs::CWD, cstr!(""), 0);
let _ = delete_module(cstr!(""), 0);
}

0 comments on commit a6a5cc8

Please sign in to comment.