Exported macro init_system
This commit is contained in:
parent
f08286e8ed
commit
2a3d8f3550
@ -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!();
|
||||||
|
Loading…
Reference in New Issue
Block a user