aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-02-12 15:08:46 +0100
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-02-12 15:08:46 +0100
commit89c922079eaefc748febdb62aeccfff598a07c69 (patch)
treeeebd97bd85976b5aa962353e2a48590e57557447 /tests
parent88599780e0eba38d9e543b7809f586479f6956bd (diff)
downloadrtic-89c922079eaefc748febdb62aeccfff598a07c69.tar.gz
rtic-89c922079eaefc748febdb62aeccfff598a07c69.tar.zst
rtic-89c922079eaefc748febdb62aeccfff598a07c69.zip
update examples and tests
Diffstat (limited to 'tests')
-rw-r--r--tests/cfail/init-divergent.rs2
-rw-r--r--tests/cfail/init-input.rs2
-rw-r--r--tests/cfail/init-output.rs2
-rw-r--r--tests/cfail/late-not-send.rs6
-rw-r--r--tests/cfail/late-uninit.rs2
-rw-r--r--tests/cpass/late-not-send.rs6
-rw-r--r--tests/cpass/late-resource.rs5
7 files changed, 15 insertions, 10 deletions
diff --git a/tests/cfail/init-divergent.rs b/tests/cfail/init-divergent.rs
index 400c805e..54813d47 100644
--- a/tests/cfail/init-divergent.rs
+++ b/tests/cfail/init-divergent.rs
@@ -11,7 +11,7 @@ use rtfm::app;
const APP: () = {
#[init]
fn init() -> ! {
- //~^ ERROR `init` must have type signature `[unsafe] fn()`
+ //~^ ERROR `init` must have type signature `[unsafe] fn() [-> init::LateResources]`
loop {}
}
};
diff --git a/tests/cfail/init-input.rs b/tests/cfail/init-input.rs
index fa79099c..3bf0cadf 100644
--- a/tests/cfail/init-input.rs
+++ b/tests/cfail/init-input.rs
@@ -11,6 +11,6 @@ use rtfm::app;
const APP: () = {
#[init]
fn init(undef: u32) {
- //~^ ERROR `init` must have type signature `[unsafe] fn()`
+ //~^ ERROR `init` must have type signature `[unsafe] fn() [-> init::LateResources]`
}
};
diff --git a/tests/cfail/init-output.rs b/tests/cfail/init-output.rs
index 1200aca7..414a35a8 100644
--- a/tests/cfail/init-output.rs
+++ b/tests/cfail/init-output.rs
@@ -11,7 +11,7 @@ use rtfm::app;
const APP: () = {
#[init]
fn init() -> u32 {
- //~^ ERROR `init` must have type signature `[unsafe] fn()`
+ //~^ ERROR `init` must have type signature `[unsafe] fn() [-> init::LateResources]`
0
}
};
diff --git a/tests/cfail/late-not-send.rs b/tests/cfail/late-not-send.rs
index b9180fed..eb3048d9 100644
--- a/tests/cfail/late-not-send.rs
+++ b/tests/cfail/late-not-send.rs
@@ -22,8 +22,10 @@ const APP: () = {
static mut X: NotSend = ();
#[init]
- fn init() {
- X = NotSend { _0: PhantomData };
+ fn init() -> init::LateResources {
+ init::LateResources {
+ X: NotSend { _0: PhantomData },
+ }
}
#[interrupt(resources = [X])]
diff --git a/tests/cfail/late-uninit.rs b/tests/cfail/late-uninit.rs
index eeb9bd41..55122ed7 100644
--- a/tests/cfail/late-uninit.rs
+++ b/tests/cfail/late-uninit.rs
@@ -1,3 +1,5 @@
+// TODO remove in v0.5.x
+
#![no_main]
#![no_std]
diff --git a/tests/cpass/late-not-send.rs b/tests/cpass/late-not-send.rs
index 06d376bd..5b278ab5 100644
--- a/tests/cpass/late-not-send.rs
+++ b/tests/cpass/late-not-send.rs
@@ -19,10 +19,12 @@ const APP: () = {
static mut Y: Option<NotSend> = None;
#[init(resources = [Y])]
- fn init() {
+ fn init() -> init::LateResources {
*resources.Y = Some(NotSend { _0: PhantomData });
- X = NotSend { _0: PhantomData };
+ init::LateResources {
+ X: NotSend { _0: PhantomData },
+ }
}
#[idle(resources = [X, Y])]
diff --git a/tests/cpass/late-resource.rs b/tests/cpass/late-resource.rs
index 94ec8c96..0dec4cbe 100644
--- a/tests/cpass/late-resource.rs
+++ b/tests/cpass/late-resource.rs
@@ -14,8 +14,7 @@ const APP: () = {
static Y: u32 = ();
#[init]
- fn init() {
- X = 0;
- Y = 1;
+ fn init() -> init::LateResources {
+ init::LateResources { X: 0, Y: 1 }
}
};