From cfcdce750bffcde5b7660b3b1af490b132774b09 Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Tue, 28 Mar 2023 19:47:42 +0200 Subject: [PATCH] Change filename in thread_manager::test-thread_context --- src/kernel/thread_manager.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/kernel/thread_manager.rs b/src/kernel/thread_manager.rs index 4734b40..07390a6 100644 --- a/src/kernel/thread_manager.rs +++ b/src/kernel/thread_manager.rs @@ -206,20 +206,21 @@ mod test { #[ignore = "Pas encore terminé, contient des bugs"] fn test_thread_context() { let mut machine = Machine::init_machine(); - loader::load("../test.o", &mut machine, 0).expect("IO Error"); + loader::load("./test/riscv_instructions/simple_arithmetics/unsigned_addition", &mut machine, 0).expect("IO Error"); + let start_pc = 0x4000; let system = &mut System::default(); let thread1 = Thread::new("th1"); let thread1 = Rc::new(RefCell::new(thread1)); system.get_thread_manager().get_g_alive().push(Rc::clone(&thread1)); let owner = Process { num_thread: 0 }; - system.get_thread_manager().start_thread(Rc::clone(&thread1), owner, 0x94 as u64, 0); - debug_assert_eq!(thread1.borrow_mut().thread_context.pc, 0x94 as u64); + system.get_thread_manager().start_thread(Rc::clone(&thread1), owner, start_pc, 0); + debug_assert_eq!(thread1.borrow_mut().thread_context.pc, start_pc); let to_run = system.get_thread_manager().find_next_to_run().unwrap(); debug_assert_eq!(to_run, Rc::clone(&thread1)); debug_assert!(system.get_thread_manager().get_g_alive().contains(&Rc::clone(&thread1))); system.get_thread_manager().switch_to(&mut machine, Rc::clone(&to_run)); debug_assert_eq!(system.get_thread_manager().g_current_thread, Option::Some(Rc::clone(&thread1))); - debug_assert_eq!(machine.pc, 0x94); + debug_assert_eq!(machine.pc, start_pc); machine.run(); }