1
0
forked from ROMEO/nexosim

Return both simulation and scheduler at init

This commit is contained in:
Serge Barral
2024-11-15 16:52:24 +01:00
parent f4686af49a
commit 0f1d876aed
20 changed files with 101 additions and 86 deletions

View File

@ -36,7 +36,8 @@ fn model_schedule_event(num_threads: usize) {
let mut simu = SimInit::with_num_threads(num_threads)
.add_model(model, mbox, "")
.init(t0)
.unwrap();
.unwrap()
.0;
simu.process_event(TestModel::trigger, (), addr).unwrap();
simu.step().unwrap();
@ -82,7 +83,8 @@ fn model_cancel_future_keyed_event(num_threads: usize) {
let mut simu = SimInit::with_num_threads(num_threads)
.add_model(model, mbox, "")
.init(t0)
.unwrap();
.unwrap()
.0;
simu.process_event(TestModel::trigger, (), addr).unwrap();
simu.step().unwrap();
@ -129,7 +131,8 @@ fn model_cancel_same_time_keyed_event(num_threads: usize) {
let mut simu = SimInit::with_num_threads(num_threads)
.add_model(model, mbox, "")
.init(t0)
.unwrap();
.unwrap()
.0;
simu.process_event(TestModel::trigger, (), addr).unwrap();
simu.step().unwrap();
@ -172,7 +175,8 @@ fn model_schedule_periodic_event(num_threads: usize) {
let mut simu = SimInit::with_num_threads(num_threads)
.add_model(model, mbox, "")
.init(t0)
.unwrap();
.unwrap()
.0;
simu.process_event(TestModel::trigger, (), addr).unwrap();
@ -224,7 +228,8 @@ fn model_cancel_periodic_event(num_threads: usize) {
let mut simu = SimInit::with_num_threads(num_threads)
.add_model(model, mbox, "")
.init(t0)
.unwrap();
.unwrap()
.0;
simu.process_event(TestModel::trigger, (), addr).unwrap();