diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cfail/borrow.rs | 4 | ||||
| -rw-r--r-- | tests/cfail/ceiling.rs | 2 | ||||
| -rw-r--r-- | tests/cfail/lock.rs | 4 | ||||
| -rw-r--r-- | tests/cfail/race-1.rs | 8 | ||||
| -rw-r--r-- | tests/cfail/race-2.rs | 6 | ||||
| -rw-r--r-- | tests/cfail/tasks-p0.rs | 12 | ||||
| -rw-r--r-- | tests/cfail/tasks-same-handler.rs | 10 | ||||
| -rw-r--r-- | tests/cfail/tasks-wrong-idle.rs | 12 | ||||
| -rw-r--r-- | tests/cfail/tasks-wrong-init.rs | 12 | ||||
| -rw-r--r-- | tests/cfail/tasks-wrong-priority.rs | 8 | ||||
| -rw-r--r-- | tests/cfail/tasks-wrong-task.rs | 10 |
11 files changed, 50 insertions, 38 deletions
diff --git a/tests/cfail/borrow.rs b/tests/cfail/borrow.rs index 6d8ab2a..ca246e7 100644 --- a/tests/cfail/borrow.rs +++ b/tests/cfail/borrow.rs @@ -1,6 +1,6 @@ -extern crate cortex_m_srp; +extern crate cortex_m_rtfm as rtfm; -use cortex_m_srp::{C1, C2, C3, C4, C5, P2, Resource}; +use rtfm::{C1, C2, C3, C4, C5, P2, Resource}; static R1: Resource<i32, C4> = Resource::new(0); static R2: Resource<i32, C3> = Resource::new(0); diff --git a/tests/cfail/ceiling.rs b/tests/cfail/ceiling.rs index 8ca8413..a10aee9 100644 --- a/tests/cfail/ceiling.rs +++ b/tests/cfail/ceiling.rs @@ -1,4 +1,4 @@ -extern crate cortex_m_srp as rtfm; +extern crate cortex_m_rtfm as rtfm; use rtfm::{C3, P0, P2, Resource}; diff --git a/tests/cfail/lock.rs b/tests/cfail/lock.rs index 83f3ec8..c69c0df 100644 --- a/tests/cfail/lock.rs +++ b/tests/cfail/lock.rs @@ -1,6 +1,6 @@ -extern crate cortex_m_srp; +extern crate cortex_m_rtfm as rtfm; -use cortex_m_srp::{C16, C2, P1, P16, P2, P3, Resource}; +use rtfm::{C16, C2, P1, P16, P2, P3, Resource}; static R1: Resource<i32, C2> = Resource::new(0); diff --git a/tests/cfail/race-1.rs b/tests/cfail/race-1.rs index cc31ef7..35a476d 100644 --- a/tests/cfail/race-1.rs +++ b/tests/cfail/race-1.rs @@ -1,18 +1,18 @@ -extern crate cortex_m_srp as srp; +extern crate cortex_m_rtfm as rtfm; -use srp::{C2, C4, P1, P3, Resource}; +use rtfm::{C2, C4, P1, P3, Resource}; static R1: Resource<i32, C2> = Resource::new(0); fn j1(prio: P1) { R1.lock(&prio, |r1, _| { // Would preempt this critical section - // srp::request(j2); + // rtfm::request(j2); }); } fn j2(prio: P3) { - srp::critical(|ceil| { + rtfm::critical(|ceil| { let r1 = R1.borrow(&prio, &ceil); //~^ error }); diff --git a/tests/cfail/race-2.rs b/tests/cfail/race-2.rs index c2f564e..23d7dd4 100644 --- a/tests/cfail/race-2.rs +++ b/tests/cfail/race-2.rs @@ -1,6 +1,6 @@ -extern crate cortex_m_srp as srp; +extern crate cortex_m_rtfm as rtfm; -use srp::{C2, C4, P1, P3, Resource}; +use rtfm::{C2, C4, P1, P3, Resource}; static R1: Resource<i32, C2> = Resource::new(0); static R2: Resource<i32, C4> = Resource::new(0); @@ -8,7 +8,7 @@ static R2: Resource<i32, C4> = Resource::new(0); fn j1(prio: P1) { R1.lock(&prio, |r1, _| { // Would preempt this critical section - // srp::request(j2); + // rtfm::request(j2); }); } diff --git a/tests/cfail/tasks-p0.rs b/tests/cfail/tasks-p0.rs index 3813963..f1e83a3 100644 --- a/tests/cfail/tasks-p0.rs +++ b/tests/cfail/tasks-p0.rs @@ -1,13 +1,13 @@ -// error-pattern: no associated item named `hw` +// error-pattern: type mismatch #![feature(used)] extern crate core; extern crate cortex_m; #[macro_use] -extern crate cortex_m_srp; +extern crate cortex_m_rtfm as rtfm; -use cortex_m_srp::{C16, P0, P1}; +use rtfm::{C16, P0, P1}; use device::interrupt::Exti0; /// Tasks can't have priority 0. Only idle has priority 0 @@ -15,9 +15,11 @@ tasks!(device, { j1: (Exti0, P0), }); -fn init(_: C16) {} +fn init(_: P0, _: &C16) {} -fn idle(_: P0) {} +fn idle(_: P0) -> ! { + loop {} +} fn j1(_task: Exti0, _prio: P1) {} diff --git a/tests/cfail/tasks-same-handler.rs b/tests/cfail/tasks-same-handler.rs index 345e65c..662a67d 100644 --- a/tests/cfail/tasks-same-handler.rs +++ b/tests/cfail/tasks-same-handler.rs @@ -5,9 +5,9 @@ extern crate core; extern crate cortex_m; #[macro_use] -extern crate cortex_m_srp; +extern crate cortex_m_rtfm as rtfm; -use cortex_m_srp::{C16, P0, P1, P2}; +use rtfm::{C16, P0, P1, P2}; use device::interrupt::Exti0; // WRONG: Two tasks mapped to the same interrupt handler @@ -16,9 +16,11 @@ tasks!(device, { j2: (Exti0, P2), }); -fn init(_: C16) {} +fn init(_: P0, _: &C16) {} -fn idle(_: P0) {} +fn idle(_: P0) -> ! { + loop {} +} fn j1(_task: Exti0, _prio: P1) {} diff --git a/tests/cfail/tasks-wrong-idle.rs b/tests/cfail/tasks-wrong-idle.rs index 8d6ef4b..77afef6 100644 --- a/tests/cfail/tasks-wrong-idle.rs +++ b/tests/cfail/tasks-wrong-idle.rs @@ -5,20 +5,22 @@ extern crate core; extern crate cortex_m; #[macro_use] -extern crate cortex_m_srp; +extern crate cortex_m_rtfm as rtfm; -use cortex_m_srp::{C16, P0, P1}; use device::interrupt::Exti0; +use rtfm::{C16, P0, P1}; /// Tasks can't have priority 0. Only idle has priority 0 tasks!(device, { j1: (Exti0, P1), }); -fn init(_: C16) {} +fn init(_: P0, _: &C16) {} -// WRONG. `idle` must have signature `fn(P1)` -fn idle(_: P1) {} +// WRONG. `idle` must have signature `fn(P0) -> !` +fn idle(_: P1) -> ! { + loop {} +} fn j1(_task: Exti0, _prio: P1) {} diff --git a/tests/cfail/tasks-wrong-init.rs b/tests/cfail/tasks-wrong-init.rs index 368772f..8b8359c 100644 --- a/tests/cfail/tasks-wrong-init.rs +++ b/tests/cfail/tasks-wrong-init.rs @@ -5,19 +5,21 @@ extern crate core; extern crate cortex_m; #[macro_use] -extern crate cortex_m_srp; +extern crate cortex_m_rtfm as rtfm; -use cortex_m_srp::{C1, P0, P1}; +use rtfm::{C1, P0, P1}; use device::interrupt::Exti0; tasks!(device, { j1: (Exti0, P1), }); -// WRONG. `init` must have signature `fn(P0, C16)` -fn init(_: P0, _: C1) {} +// WRONG. `init` must have signature `fn(P0, &C16)` +fn init(_: P0, _: &C1) {} -fn idle(_: P0) {} +fn idle(_: P0) -> ! { + loop {} +} fn j1(_task: Exti0, _prio: P1) {} diff --git a/tests/cfail/tasks-wrong-priority.rs b/tests/cfail/tasks-wrong-priority.rs index 741a96a..08deef3 100644 --- a/tests/cfail/tasks-wrong-priority.rs +++ b/tests/cfail/tasks-wrong-priority.rs @@ -5,7 +5,7 @@ extern crate core; extern crate cortex_m; #[macro_use] -extern crate cortex_m_srp; +extern crate cortex_m_rtfm as rtfm; use cortex_m_srp::{C16, P0, P1, P2}; use device::interrupt::Exti1; @@ -14,9 +14,11 @@ tasks!(device, { j1: (Exti0, P1), }); -fn init(_: C16) {} +fn init(_: P0, _: &C16) {} -fn idle(_: P0) {} +fn idle(_: P0) -> ! { + loop {} +} // Wrong priority token. Declared P1, got P2 fn j1(_task: Exti1, _prio: P1) {} diff --git a/tests/cfail/tasks-wrong-task.rs b/tests/cfail/tasks-wrong-task.rs index ee69a8b..15bd776 100644 --- a/tests/cfail/tasks-wrong-task.rs +++ b/tests/cfail/tasks-wrong-task.rs @@ -5,18 +5,20 @@ extern crate core; extern crate cortex_m; #[macro_use] -extern crate cortex_m_srp; +extern crate cortex_m_rtfm as rtfm; -use cortex_m_srp::{C16, P0, P1}; +use cortex_mrtfm::{C16, P0, P1}; use device::interrupt::Exti1; tasks!(device, { j1: (Exti0, P1), }); -fn init(_: C16) {} +fn init(_: P0, _: &C16) {} -fn idle(_: P0) {} +fn idle(_: P0) -> ! { + loop {} +} // Wrong task token. Declared Exti0, got Exti1 fn j1(_task: Exti1, _prio: P1) {} |
