aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-04-21 20:20:15 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-05-01 20:49:25 +0200
commitd0aaa2a805afdda30b49b3dfdb7072f302855a79 (patch)
tree037714c3934d616eb3015b827a6bcd54d53cb52e
parentd2fb62f729de3ad24132b69298e17193ac334df4 (diff)
downloadrtic-d0aaa2a805afdda30b49b3dfdb7072f302855a79.tar.gz
rtic-d0aaa2a805afdda30b49b3dfdb7072f302855a79.tar.zst
rtic-d0aaa2a805afdda30b49b3dfdb7072f302855a79.zip
update compile-fail tests
-rw-r--r--tests/cfail/cfg-resources.rs38
-rw-r--r--tests/cfail/cfg-static.rs10
-rw-r--r--tests/cfail/duplicate-args-2.rs4
-rw-r--r--tests/cfail/duplicate-args.rs4
-rw-r--r--tests/cfail/early-return-2.rs29
-rw-r--r--tests/cfail/early-return.rs32
-rw-r--r--tests/cfail/exception-divergent.rs6
-rw-r--r--tests/cfail/exception-input.rs6
-rw-r--r--tests/cfail/exception-invalid.rs4
-rw-r--r--tests/cfail/exception-output.rs6
-rw-r--r--tests/cfail/exception-sys-tick.rs4
-rw-r--r--tests/cfail/idle-input.rs6
-rw-r--r--tests/cfail/idle-not-divergent.rs6
-rw-r--r--tests/cfail/init-divergent.rs4
-rw-r--r--tests/cfail/init-input.rs4
-rw-r--r--tests/cfail/init-not-send.rs7
-rw-r--r--tests/cfail/init-output.rs4
-rw-r--r--tests/cfail/insufficient-free-interrupts.rs4
-rw-r--r--tests/cfail/interrupt-divergent.rs6
-rw-r--r--tests/cfail/interrupt-input.rs6
-rw-r--r--tests/cfail/interrupt-output.rs6
-rw-r--r--tests/cfail/late-assigned-to-init.rs2
-rw-r--r--tests/cfail/late-not-send.rs5
-rw-r--r--tests/cfail/late-uninit.rs18
-rw-r--r--tests/cfail/needs-send.rs5
-rw-r--r--tests/cfail/needs-sync.rs7
-rw-r--r--tests/cfail/priority-too-high.rs6
-rw-r--r--tests/cfail/priority-too-low.rs6
-rw-r--r--tests/cfail/resource-not-declared.rs2
-rw-r--r--tests/cfail/resource-pub.rs2
-rw-r--r--tests/cfail/task-divergent.rs10
-rw-r--r--tests/cfail/task-idle.rs4
-rw-r--r--tests/cfail/task-not-declared.rs2
-rw-r--r--tests/cfail/used-free-interrupt-2.rs4
-rw-r--r--tests/cfail/used-free-interrupt.rs5
35 files changed, 95 insertions, 179 deletions
diff --git a/tests/cfail/cfg-resources.rs b/tests/cfail/cfg-resources.rs
index dee1485b..5e20c4de 100644
--- a/tests/cfail/cfg-resources.rs
+++ b/tests/cfail/cfg-resources.rs
@@ -30,35 +30,35 @@ const APP: () = {
static S3: u32 = 0;
#[init(resources = [O1, O4, O5, O6, S3])]
- fn init() {
- resources.O1; //~ ERROR no field `O1`
- resources.O4; //~ ERROR no field `O4`
- resources.O5; //~ ERROR no field `O5`
- resources.O6; //~ ERROR no field `O6`
- resources.S3; //~ ERROR no field `S3`
+ fn init(c: init::Context) {
+ c.resources.O1; //~ ERROR no field `O1`
+ c.resources.O4; //~ ERROR no field `O4`
+ c.resources.O5; //~ ERROR no field `O5`
+ c.resources.O6; //~ ERROR no field `O6`
+ c.resources.S3; //~ ERROR no field `S3`
}
#[idle(resources = [O2, O4, S1, S3])]
- fn idle() -> ! {
- resources.O2; //~ ERROR no field `O2`
- resources.O4; //~ ERROR no field `O4`
- resources.S1; //~ ERROR no field `S1`
- resources.S3; //~ ERROR no field `S3`
+ fn idle(c: idle::Context) -> ! {
+ c.resources.O2; //~ ERROR no field `O2`
+ c.resources.O4; //~ ERROR no field `O4`
+ c.resources.S1; //~ ERROR no field `S1`
+ c.resources.S3; //~ ERROR no field `S3`
loop {}
}
#[interrupt(resources = [O3, S1, S2, S3])]
- fn UART0() {
- resources.O3; //~ ERROR no field `O3`
- resources.S1; //~ ERROR no field `S1`
- resources.S2; //~ ERROR no field `S2`
- resources.S3; //~ ERROR no field `S3`
+ fn UART0(c: UART0::Context) {
+ c.resources.O3; //~ ERROR no field `O3`
+ c.resources.S1; //~ ERROR no field `S1`
+ c.resources.S2; //~ ERROR no field `S2`
+ c.resources.S3; //~ ERROR no field `S3`
}
#[interrupt(resources = [S2, O5])]
- fn UART1() {
- resources.S2; //~ ERROR no field `S2`
- resources.O5; //~ ERROR no field `O5`
+ fn UART1(c: UART1::Context) {
+ c.resources.S2; //~ ERROR no field `S2`
+ c.resources.O5; //~ ERROR no field `O5`
}
};
diff --git a/tests/cfail/cfg-static.rs b/tests/cfail/cfg-static.rs
index 0d27e533..91465a1e 100644
--- a/tests/cfail/cfg-static.rs
+++ b/tests/cfail/cfg-static.rs
@@ -10,7 +10,7 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {
+ fn init(_: init::Context) {
#[cfg(never)]
static mut FOO: u32 = 0;
@@ -18,7 +18,7 @@ const APP: () = {
}
#[idle]
- fn idle() -> ! {
+ fn idle(_: idle::Context) -> ! {
#[cfg(never)]
static mut FOO: u32 = 0;
@@ -28,7 +28,7 @@ const APP: () = {
}
#[exception]
- fn SVCall() {
+ fn SVCall(_: SVCall::Context) {
#[cfg(never)]
static mut FOO: u32 = 0;
@@ -36,7 +36,7 @@ const APP: () = {
}
#[interrupt]
- fn UART0() {
+ fn UART0(_: UART0::Context) {
#[cfg(never)]
static mut FOO: u32 = 0;
@@ -44,7 +44,7 @@ const APP: () = {
}
#[task]
- fn foo() {
+ fn foo(_: foo::Context) {
#[cfg(never)]
static mut FOO: u32 = 0;
diff --git a/tests/cfail/duplicate-args-2.rs b/tests/cfail/duplicate-args-2.rs
index 1a196e99..5bef79b5 100644
--- a/tests/cfail/duplicate-args-2.rs
+++ b/tests/cfail/duplicate-args-2.rs
@@ -10,13 +10,13 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[task(
priority = 1,
priority = 2, //~ ERROR argument appears more than once
)]
- fn foo() {}
+ fn foo(_: foo::Context) {}
extern "C" {
fn UART0();
diff --git a/tests/cfail/duplicate-args.rs b/tests/cfail/duplicate-args.rs
index a946bae2..6938cd0d 100644
--- a/tests/cfail/duplicate-args.rs
+++ b/tests/cfail/duplicate-args.rs
@@ -10,13 +10,13 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[task(
capacity = 1,
capacity = 2, //~ ERROR argument appears more than once
)]
- fn foo() {}
+ fn foo(_: foo::Context) {}
extern "C" {
fn UART0();
diff --git a/tests/cfail/early-return-2.rs b/tests/cfail/early-return-2.rs
deleted file mode 100644
index bf867e07..00000000
--- a/tests/cfail/early-return-2.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-#![no_main]
-#![no_std]
-
-extern crate lm3s6965;
-extern crate panic_halt;
-extern crate rtfm;
-
-use rtfm::app;
-
-#[app(device = lm3s6965)]
-const APP: () = {
- static mut UNINITIALIZED: bool = ();
-
- #[init]
- fn init() {
- if false {
- return; //~ ERROR `init` is *not* allowed to early return
- }
-
- UNINITIALIZED = true;
- }
-
- #[interrupt(resources = [UNINITIALIZED])]
- fn UART0() {
- if resources.UNINITIALIZED {
- // UB
- }
- }
-};
diff --git a/tests/cfail/early-return.rs b/tests/cfail/early-return.rs
deleted file mode 100644
index fb695aac..00000000
--- a/tests/cfail/early-return.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-#![no_main]
-#![no_std]
-
-extern crate lm3s6965;
-extern crate panic_halt;
-extern crate rtfm;
-
-use rtfm::app;
-
-#[app(device = lm3s6965)]
-const APP: () = {
- static mut UNINITIALIZED: bool = ();
-
- #[init]
- fn init() {
- let x = || {
- // this is OK
- return 0;
- };
-
- return; //~ ERROR `init` is *not* allowed to early return
-
- UNINITIALIZED = true;
- }
-
- #[interrupt(resources = [UNINITIALIZED])]
- fn UART0() {
- if resources.UNINITIALIZED {
- // UB
- }
- }
-};
diff --git a/tests/cfail/exception-divergent.rs b/tests/cfail/exception-divergent.rs
index 692a57c7..3fe9a365 100644
--- a/tests/cfail/exception-divergent.rs
+++ b/tests/cfail/exception-divergent.rs
@@ -10,11 +10,11 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[exception]
- fn SVCall() -> ! {
- //~^ ERROR `exception` handlers must have type signature `[unsafe] fn()`
+ fn SVCall(_: SVCall::Context) -> ! {
+ //~^ ERROR this `exception` handler must have type signature `fn(SVCall::Context)`
loop {}
}
};
diff --git a/tests/cfail/exception-input.rs b/tests/cfail/exception-input.rs
index cb0711ce..d1363fe5 100644
--- a/tests/cfail/exception-input.rs
+++ b/tests/cfail/exception-input.rs
@@ -10,10 +10,10 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[exception]
- fn SVCall(undef: u32) {
- //~^ ERROR `exception` handlers must have type signature `[unsafe] fn()`
+ fn SVCall(_: SVCall::Context, undef: u32) {
+ //~^ ERROR this `exception` handler must have type signature `fn(SVCall::Context)`
}
};
diff --git a/tests/cfail/exception-invalid.rs b/tests/cfail/exception-invalid.rs
index 0a7fb520..4bb8f1ec 100644
--- a/tests/cfail/exception-invalid.rs
+++ b/tests/cfail/exception-invalid.rs
@@ -10,10 +10,10 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[exception]
- fn NonMaskableInt() {
+ fn NonMaskableInt(_: NonMaskableInt::Context) {
//~^ ERROR only exceptions with configurable priority can be used as hardware tasks
}
};
diff --git a/tests/cfail/exception-output.rs b/tests/cfail/exception-output.rs
index 758dbdd7..8f672985 100644
--- a/tests/cfail/exception-output.rs
+++ b/tests/cfail/exception-output.rs
@@ -10,11 +10,11 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[exception]
- fn SVCall() -> u32 {
- //~^ ERROR `exception` handlers must have type signature `[unsafe] fn()`
+ fn SVCall(_: SVCall::Context) -> u32 {
+ //~^ ERROR this `exception` handler must have type signature `fn(SVCall::Context)`
0
}
};
diff --git a/tests/cfail/exception-sys-tick.rs b/tests/cfail/exception-sys-tick.rs
index 69d73dbc..d5eae20b 100644
--- a/tests/cfail/exception-sys-tick.rs
+++ b/tests/cfail/exception-sys-tick.rs
@@ -10,10 +10,10 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[exception]
- fn SysTick() {
+ fn SysTick(_: SysTick::Context) {
//~^ ERROR the `SysTick` exception can't be used because it's used by the runtime
}
};
diff --git a/tests/cfail/idle-input.rs b/tests/cfail/idle-input.rs
index 5095977e..feb83e8b 100644
--- a/tests/cfail/idle-input.rs
+++ b/tests/cfail/idle-input.rs
@@ -10,10 +10,10 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[idle]
- fn idle(undef: u32) {
- //~^ ERROR `idle` must have type signature `[unsafe] fn() -> !`
+ fn idle(_: idle::Context, undef: u32) {
+ //~^ ERROR `idle` must have type signature `fn(idle::Context) -> !`
}
};
diff --git a/tests/cfail/idle-not-divergent.rs b/tests/cfail/idle-not-divergent.rs
index e90eff08..505fba14 100644
--- a/tests/cfail/idle-not-divergent.rs
+++ b/tests/cfail/idle-not-divergent.rs
@@ -10,10 +10,10 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[idle]
- fn idle() {
- //~^ ERROR `idle` must have type signature `[unsafe] fn() -> !`
+ fn idle(_: idle::Context) {
+ //~^ ERROR `idle` must have type signature `fn(idle::Context) -> !`
}
};
diff --git a/tests/cfail/init-divergent.rs b/tests/cfail/init-divergent.rs
index 54813d47..0e779ffc 100644
--- a/tests/cfail/init-divergent.rs
+++ b/tests/cfail/init-divergent.rs
@@ -10,8 +10,8 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() -> ! {
- //~^ ERROR `init` must have type signature `[unsafe] fn() [-> init::LateResources]`
+ fn init(_: init::Context) -> ! {
+ //~^ ERROR `init` must have type signature `fn(init::Context) [-> init::LateResources]`
loop {}
}
};
diff --git a/tests/cfail/init-input.rs b/tests/cfail/init-input.rs
index 3bf0cadf..9063efe3 100644
--- a/tests/cfail/init-input.rs
+++ b/tests/cfail/init-input.rs
@@ -10,7 +10,7 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init(undef: u32) {
- //~^ ERROR `init` must have type signature `[unsafe] fn() [-> init::LateResources]`
+ fn init(_: init::Context, undef: u32) {
+ //~^ ERROR `init` must have type signature `fn(init::Context) [-> init::LateResources]`
}
};
diff --git a/tests/cfail/init-not-send.rs b/tests/cfail/init-not-send.rs
index 3ac495f5..5a33fac7 100644
--- a/tests/cfail/init-not-send.rs
+++ b/tests/cfail/init-not-send.rs
@@ -1,6 +1,5 @@
//! This is equivalent to the `late-not-send` cfail test
-#![feature(extern_crate_item_prelude)] // ???
#![no_main]
#![no_std]
@@ -21,10 +20,10 @@ const APP: () = {
static mut X: Option<NotSend> = None;
#[init(resources = [X])]
- fn init() {
- *resources.X = Some(NotSend { _0: PhantomData })
+ fn init(c: init::Context) {
+ *c.resources.X = Some(NotSend { _0: PhantomData })
}
#[interrupt(resources = [X])]
- fn UART0() {}
+ fn UART0(_: UART0::Context) {}
};
diff --git a/tests/cfail/init-output.rs b/tests/cfail/init-output.rs
index 414a35a8..f88d5340 100644
--- a/tests/cfail/init-output.rs
+++ b/tests/cfail/init-output.rs
@@ -10,8 +10,8 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() -> u32 {
- //~^ ERROR `init` must have type signature `[unsafe] fn() [-> init::LateResources]`
+ fn init(_: init::Context) -> u32 {
+ //~^ ERROR `init` must have type signature `fn(init::Context) [-> init::LateResources]`
0
}
};
diff --git a/tests/cfail/insufficient-free-interrupts.rs b/tests/cfail/insufficient-free-interrupts.rs
index baa2582b..7148fbf3 100644
--- a/tests/cfail/insufficient-free-interrupts.rs
+++ b/tests/cfail/insufficient-free-interrupts.rs
@@ -10,8 +10,8 @@ use rtfm::app;
#[app(device = lm3s6965)] //~ ERROR 1 free interrupt (`extern { .. }`) is required
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[task]
- fn foo() {}
+ fn foo(_: foo::Context) {}
};
diff --git a/tests/cfail/interrupt-divergent.rs b/tests/cfail/interrupt-divergent.rs
index 4a015330..b67601ee 100644
--- a/tests/cfail/interrupt-divergent.rs
+++ b/tests/cfail/interrupt-divergent.rs
@@ -10,11 +10,11 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[interrupt]
- fn UART0() -> ! {
- //~^ ERROR `interrupt` handlers must have type signature `[unsafe] fn()`
+ fn UART0(_: UART0::Context) -> ! {
+ //~^ ERROR this `interrupt` handler must have type signature `fn(UART0::Context)`
loop {}
}
};
diff --git a/tests/cfail/interrupt-input.rs b/tests/cfail/interrupt-input.rs
index d0240f4e..f11b2d39 100644
--- a/tests/cfail/interrupt-input.rs
+++ b/tests/cfail/interrupt-input.rs
@@ -10,10 +10,10 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[interrupt]
- fn UART0(undef: u32) {
- //~^ ERROR `interrupt` handlers must have type signature `[unsafe] fn()`
+ fn UART0(_: UART0::Context, undef: u32) {
+ //~^ ERROR this `interrupt` handler must have type signature `fn(UART0::Context)`
}
};
diff --git a/tests/cfail/interrupt-output.rs b/tests/cfail/interrupt-output.rs
index 37cd7c21..69e4957f 100644
--- a/tests/cfail/interrupt-output.rs
+++ b/tests/cfail/interrupt-output.rs
@@ -10,11 +10,11 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[interrupt]
- fn UART0() -> u32 {
- //~^ ERROR `interrupt` handlers must have type signature `[unsafe] fn()`
+ fn UART0(_: UART0::Context) -> u32 {
+ //~^ ERROR this `interrupt` handler must have type signature `fn(UART0::Context)`
0
}
};
diff --git a/tests/cfail/late-assigned-to-init.rs b/tests/cfail/late-assigned-to-init.rs
index 70a361c1..00d6c8ce 100644
--- a/tests/cfail/late-assigned-to-init.rs
+++ b/tests/cfail/late-assigned-to-init.rs
@@ -12,5 +12,5 @@ const APP: () = {
static mut X: u32 = ();
#[init(resources = [X])] //~ ERROR late resources can NOT be assigned to `init`
- fn init() {}
+ fn init(_: init::Context) {}
};
diff --git a/tests/cfail/late-not-send.rs b/tests/cfail/late-not-send.rs
index eb3048d9..04a4af15 100644
--- a/tests/cfail/late-not-send.rs
+++ b/tests/cfail/late-not-send.rs
@@ -1,7 +1,6 @@
//! `init` has a static priority of `0`. Initializing resources from it is equivalent to sending a
//! message to the task that will own the resource
-#![feature(extern_crate_item_prelude)] // ???
#![no_main]
#![no_std]
@@ -22,12 +21,12 @@ const APP: () = {
static mut X: NotSend = ();
#[init]
- fn init() -> init::LateResources {
+ fn init(_: init::Context) -> init::LateResources {
init::LateResources {
X: NotSend { _0: PhantomData },
}
}
#[interrupt(resources = [X])]
- fn UART0() {}
+ fn UART0(_: UART0::Context) {}
};
diff --git a/tests/cfail/late-uninit.rs b/tests/cfail/late-uninit.rs
deleted file mode 100644
index 55122ed7..00000000
--- a/tests/cfail/late-uninit.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// TODO remove in v0.5.x
-
-#![no_main]
-#![no_std]
-
-extern crate lm3s6965;
-extern crate panic_halt;
-extern crate rtfm;
-
-use rtfm::app;
-
-#[app(device = lm3s6965)]
-const APP: () = {
- static mut X: u32 = (); //~ ERROR late resources MUST be initialized at the end of `init`
-
- #[init]
- fn init() {}
-};
diff --git a/tests/cfail/needs-send.rs b/tests/cfail/needs-send.rs
index 7e3ca306..8dc9707f 100644
--- a/tests/cfail/needs-send.rs
+++ b/tests/cfail/needs-send.rs
@@ -1,4 +1,3 @@
-#![feature(extern_crate_item_prelude)] // ???
#![no_main]
#![no_std]
@@ -19,10 +18,10 @@ unsafe impl Sync for NotSend {}
#[app(device = lm3s6965)] //~ ERROR cannot be sent between threads safely
const APP: () = {
#[init(spawn = [foo])]
- fn init() {}
+ fn init(_: init::Context) {}
#[task]
- fn foo(_x: NotSend) {}
+ fn foo(_: foo::Context, _x: NotSend) {}
extern "C" {
fn UART0();
diff --git a/tests/cfail/needs-sync.rs b/tests/cfail/needs-sync.rs
index f25f91a2..6025e7d5 100644
--- a/tests/cfail/needs-sync.rs
+++ b/tests/cfail/needs-sync.rs
@@ -1,4 +1,3 @@
-#![feature(extern_crate_item_prelude)] // ???
#![no_main]
#![no_std]
@@ -21,13 +20,13 @@ const APP: () = {
static X: NotSync = NotSync { _0: PhantomData };
#[init(spawn = [foo])]
- fn init() {}
+ fn init(_: init::Context) {}
#[task(priority = 1, resources = [X])]
- fn foo() {}
+ fn foo(_: foo::Context) {}
#[task(priority = 2, resources = [X])]
- fn bar() {}
+ fn bar(_: bar::Context) {}
extern "C" {
fn UART0();
diff --git a/tests/cfail/priority-too-high.rs b/tests/cfail/priority-too-high.rs
index ec324014..817462a3 100644
--- a/tests/cfail/priority-too-high.rs
+++ b/tests/cfail/priority-too-high.rs
@@ -10,13 +10,13 @@ use rtfm::app;
#[app(device = lm3s6965)] //~ error evaluation of constant value failed
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
// OK, this is the maximum priority supported by the device
#[interrupt(priority = 8)]
- fn UART0() {}
+ fn UART0(_: UART0::Context) {}
// this value is too high!
#[interrupt(priority = 9)]
- fn UART1() {}
+ fn UART1(_: UART1::Context) {}
};
diff --git a/tests/cfail/priority-too-low.rs b/tests/cfail/priority-too-low.rs
index 6dcbfd63..361156df 100644
--- a/tests/cfail/priority-too-low.rs
+++ b/tests/cfail/priority-too-low.rs
@@ -10,13 +10,13 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
// OK, this is the minimum priority that tasks can have
#[interrupt(priority = 1)]
- fn UART0() {}
+ fn UART0(_: UART0::Context) {}
// this value is too low!
#[interrupt(priority = 0)] //~ error this literal must be in the range 1...255
- fn UART1() {}
+ fn UART1(_: UART1::Context) {}
};
diff --git a/tests/cfail/resource-not-declared.rs b/tests/cfail/resource-not-declared.rs
index f6d08a65..a37be42d 100644
--- a/tests/cfail/resource-not-declared.rs
+++ b/tests/cfail/resource-not-declared.rs
@@ -10,5 +10,5 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init(resources = [X])] //~ ERROR this resource has NOT been declared
- fn init() {}
+ fn init(_: init::Context) {}
};
diff --git a/tests/cfail/resource-pub.rs b/tests/cfail/resource-pub.rs
index 970fc6cc..3fb21f46 100644
--- a/tests/cfail/resource-pub.rs
+++ b/tests/cfail/resource-pub.rs
@@ -13,5 +13,5 @@ const APP: () = {
//~^ ERROR resources must have inherited / private visibility
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
};
diff --git a/tests/cfail/task-divergent.rs b/tests/cfail/task-divergent.rs
index 3822d754..577f0e06 100644
--- a/tests/cfail/task-divergent.rs
+++ b/tests/cfail/task-divergent.rs
@@ -5,16 +5,14 @@ extern crate lm3s6965;
extern crate panic_halt;
extern crate rtfm;
-use rtfm::app;
-
-#[app(device = lm3s6965)]
+#[rtfm::app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[task]
- fn foo() -> ! {
- //~^ ERROR `task` handlers must have type signature `[unsafe] fn(..)`
+ fn foo(_: foo::Context) -> ! {
+ //~^ ERROR this `task` handler must have type signature `fn(foo::Context, ..)`
loop {}
}
diff --git a/tests/cfail/task-idle.rs b/tests/cfail/task-idle.rs
index 62d927b9..963bf1ee 100644
--- a/tests/cfail/task-idle.rs
+++ b/tests/cfail/task-idle.rs
@@ -10,10 +10,10 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[task]
- fn idle() {
+ fn idle(_: idle::Context) {
//~^ ERROR `task` handlers can NOT be named `idle`, `init` or `resources`
}
diff --git a/tests/cfail/task-not-declared.rs b/tests/cfail/task-not-declared.rs
index 3e6d87c4..04309f59 100644
--- a/tests/cfail/task-not-declared.rs
+++ b/tests/cfail/task-not-declared.rs
@@ -10,5 +10,5 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init(spawn = [X])] //~ ERROR this task has NOT been declared
- fn init() {}
+ fn init(_: init::Context) {}
};
diff --git a/tests/cfail/used-free-interrupt-2.rs b/tests/cfail/used-free-interrupt-2.rs
index 616d308d..ba9424fd 100644
--- a/tests/cfail/used-free-interrupt-2.rs
+++ b/tests/cfail/used-free-interrupt-2.rs
@@ -10,10 +10,10 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[interrupt(binds = UART0)] //~ ERROR free interrupts (`extern { .. }`) can't be used as interrupt handlers
- fn foo() {}
+ fn foo(_: foo::Context) {}
extern "C" {
fn UART0();
diff --git a/tests/cfail/used-free-interrupt.rs b/tests/cfail/used-free-interrupt.rs
index 78ae5407..1a56741b 100644
--- a/tests/cfail/used-free-interrupt.rs
+++ b/tests/cfail/used-free-interrupt.rs
@@ -10,10 +10,11 @@ use rtfm::app;
#[app(device = lm3s6965)]
const APP: () = {
#[init]
- fn init() {}
+ fn init(_: init::Context) {}
#[interrupt]
- fn UART0() {} //~ ERROR free interrupts (`extern { .. }`) can't be used as interrupt handlers
+ fn UART0(_: UART0::Context) {}
+ //~^ ERROR free interrupts (`extern { .. }`) can't be used as interrupt handlers
extern "C" {
fn UART0();