Changed constructor to allow any string slice as parameter + started writing unit tests
This commit is contained in:
parent
26b75ffe8d
commit
eeac26aba6
@ -23,9 +23,9 @@ pub struct Thread {
|
||||
impl Thread {
|
||||
|
||||
/// Thread constructor
|
||||
pub fn new(name: String) -> Self {
|
||||
pub fn new(name: &str) -> Self {
|
||||
Self {
|
||||
name,
|
||||
name: String::from(name),
|
||||
process: None,
|
||||
// simulation_context: UContextT::new(),
|
||||
thread_context: ThreadContext {
|
||||
@ -98,4 +98,15 @@ impl Drop for Thread {
|
||||
|
||||
fn start_thread_execution() {
|
||||
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
|
||||
use super::Thread;
|
||||
|
||||
fn get_new_thread() -> Thread {
|
||||
Thread::new("test_thread")
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user