Add dummy functoin that does a simple addition to verify that unit tests are working
Signed-off-by: Noah Knegt <git@noahknegt.com>
This commit is contained in:
@@ -21,6 +21,7 @@ pub fn main(boot_info: &'static mut BootInfo) -> ! {
|
||||
logger::init_logger(buffer, info);
|
||||
|
||||
log::info!("Hello World from KERNEL");
|
||||
log::debug!("ADDING 1 & 6, result == {}", add(1, 6));
|
||||
|
||||
// Endless loop as the kernel must stay running
|
||||
loop {}
|
||||
@@ -33,3 +34,12 @@ fn panic(info: &core::panic::PanicInfo) -> ! {
|
||||
log::error!("{}", info);
|
||||
loop {}
|
||||
}
|
||||
|
||||
fn add(a: i32, b: i32) -> i32 {
|
||||
a + b
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn add_test() {
|
||||
assert_eq!(add(1, 2), 3);
|
||||
}
|
||||
|
Reference in New Issue
Block a user