Put default thread name in a const

This commit is contained in:
François Autin 2023-03-09 13:33:00 +01:00
parent 6e6b97911a
commit 9a86520a77
No known key found for this signature in database
GPG Key ID: 343F5D382E1DD77C

View File

@ -104,17 +104,18 @@ fn start_thread_execution() {
mod test {
use super::{Thread, ThreadContext, NUM_INT_REGS, NUM_FP_REGS, ObjectType};
const DEFAULT_THREAD_NAME: &str = "test_thread";
macro_rules! get_new_thread {
() => { Thread::new("test_thread") };
() => { Thread::new(DEFAULT_THREAD_NAME) };
($a:literal) => {
Thread::new(&$a.to_string())
};
}
macro_rules! expected_initial_state {
() => { expected_initial_state!("test_thread") };
($a:literal) => { {
() => { expected_initial_state!(DEFAULT_THREAD_NAME) };
($a:expr) => { {
let mut x = Thread::new($a);
x.name = $a.to_string();
x.process = Option::None;