Changed constructor to allow any string slice as parameter + started writing unit tests
This commit is contained in:
parent
d392c69535
commit
0f339dd936
@ -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 {
|
||||
@ -99,3 +99,14 @@ 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