-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fd0bc2
commit bcf7c37
Showing
2 changed files
with
36 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,34 @@ | ||
pub fn add(left: usize, right: usize) -> usize { | ||
left + right | ||
} | ||
#![allow(non_camel_case_types)] | ||
#![allow(non_snake_case)] | ||
#![allow(non_upper_case_globals)] | ||
|
||
use log::{error, info}; | ||
|
||
pub fn Initialize() { | ||
info!("Initializing..."); | ||
|
||
info!("Initialize task module"); | ||
|
||
if let Err(Error) = Task::Initialize() { | ||
error!("Failed to initialize the task module: {:?}", Error); | ||
std::process::exit(1); | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
info!("Initialization user module"); | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
if let Err(Error) = Users::Initialize() { | ||
error!("Failed to initialize the user module: {:?}", Error); | ||
std::process::exit(1); | ||
} | ||
|
||
info!("Initialize file system module"); | ||
|
||
if let Err(Error) = File_system::Initialize() { | ||
error!("Failed to initialize the file system module: {:?}", Error); | ||
std::process::exit(1); | ||
} | ||
|
||
info!("Initialize virtual machine module"); | ||
|
||
info!("Initialization complete"); | ||
} |