From 6d2bb545d4752f328e48634c282c14086f31dba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Thu, 2 Jan 2025 15:46:11 +0100 Subject: [PATCH] test: add `get_application_parameters` test --- src/syscalls/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/syscalls/mod.rs b/src/syscalls/mod.rs index ba749419da..1b0a96af9b 100644 --- a/src/syscalls/mod.rs +++ b/src/syscalls/mod.rs @@ -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()); + } +}