Skip to content

Commit

Permalink
test: add get_application_parameters test
Browse files Browse the repository at this point in the history
  • Loading branch information
mkroening committed Jan 2, 2025
1 parent 727290d commit 6d2bb54
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/syscalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,3 +683,17 @@ pub extern "C" fn sys_eventfd(initval: u64, flags: i16) -> i32 {
pub extern "C" fn sys_image_start_addr() -> usize {
crate::mm::kernel_start_address().as_usize()
}

#[cfg(test)]
mod tests {
use super::*;

#[cfg(target_os = "none")]
#[test_case]
fn test_get_application_parameters() {
crate::env::init();
let (argc, argv, _envp) = get_application_parameters();
assert_ne!(argc, 0);
assert_ne!(argv, ptr::null());
}
}

0 comments on commit 6d2bb54

Please sign in to comment.