Exported macro init_system

This commit is contained in:
François Autin 2023-03-15 10:10:53 +01:00
parent f08286e8ed
commit 2a3d8f3550

View File

@ -4,6 +4,18 @@ use crate::simulator::machine::Machine;
use super::thread_manager::ThreadManager; use super::thread_manager::ThreadManager;
/// This macro properly initializes the system
#[macro_export]
macro_rules! init_system {
() => {{
let m = Machine::init_machine();
init_system!(m)
}};
($a:expr) => {{
System::new($a)
}};
}
/// # System /// # System
/// ///
/// This structure represents the state of the threads running on the operating system. /// This structure represents the state of the threads running on the operating system.
@ -71,16 +83,6 @@ mod tests {
use crate::{System, Machine}; use crate::{System, Machine};
macro_rules! init_system {
() => {{
let m = Machine::init_machine();
init_system!(m)
}};
($a:expr) => {{
System::new($a)
}};
}
#[test] #[test]
fn test_init_system() { fn test_init_system() {
init_system!(); init_system!();