Put default thread name in a const
This commit is contained in:
parent
6e6b97911a
commit
9a86520a77
@ -104,17 +104,18 @@ fn start_thread_execution() {
|
|||||||
mod test {
|
mod test {
|
||||||
|
|
||||||
use super::{Thread, ThreadContext, NUM_INT_REGS, NUM_FP_REGS, ObjectType};
|
use super::{Thread, ThreadContext, NUM_INT_REGS, NUM_FP_REGS, ObjectType};
|
||||||
|
const DEFAULT_THREAD_NAME: &str = "test_thread";
|
||||||
|
|
||||||
macro_rules! get_new_thread {
|
macro_rules! get_new_thread {
|
||||||
() => { Thread::new("test_thread") };
|
() => { Thread::new(DEFAULT_THREAD_NAME) };
|
||||||
($a:literal) => {
|
($a:literal) => {
|
||||||
Thread::new(&$a.to_string())
|
Thread::new(&$a.to_string())
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! expected_initial_state {
|
macro_rules! expected_initial_state {
|
||||||
() => { expected_initial_state!("test_thread") };
|
() => { expected_initial_state!(DEFAULT_THREAD_NAME) };
|
||||||
($a:literal) => { {
|
($a:expr) => { {
|
||||||
let mut x = Thread::new($a);
|
let mut x = Thread::new($a);
|
||||||
x.name = $a.to_string();
|
x.name = $a.to_string();
|
||||||
x.process = Option::None;
|
x.process = Option::None;
|
||||||
|
Loading…
Reference in New Issue
Block a user