update the cfail tests

This commit is contained in:
Jorge Aparicio 2018-05-01 14:01:51 +02:00
parent 205aa44ed5
commit e34abea704
22 changed files with 258 additions and 187 deletions

View file

@ -1,13 +1,13 @@
#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(const_fn)]
#![feature(proc_macro)]
#![no_std]
extern crate cortex_m_rtfm as rtfm;
extern crate panic_abort;
extern crate stm32f103xx;
use rtfm::{app, Threshold};
use rtfm::app;
app! {
device: stm32f103xx,
@ -17,38 +17,47 @@ app! {
},
tasks: {
EXTI0: {
path: exti0,
priority: 1,
exti0: {
interrupt: EXTI0,
// priority: 1,
resources: [SHARED],
},
EXTI1: {
path: exti1,
exti1: {
interrupt: EXTI1,
priority: 2,
resources: [SHARED],
},
},
}
fn init(_p: init::Peripherals, _r: init::Resources) {}
fn init(_ctxt: init::Context) -> init::LateResources {
init::LateResources {}
}
fn idle() -> ! {
fn idle(_ctxt: idle::Context) -> ! {
loop {}
}
fn is_send<T>(_: &T) where T: Send {}
fn is_sync<T>(_: &T) where T: Sync {}
fn is_send<T>(_: &T)
where
T: Send,
{
}
fn is_sync<T>(_: &T)
where
T: Sync,
{
}
fn exti0(_t: &mut Threshold, r: EXTI0::Resources) {
fn exti0(ctxt: exti0::Context) {
// ERROR resource proxies can't be shared between tasks
is_sync(&r.SHARED);
is_sync(&ctxt.resources.SHARED);
//~^ error `*const ()` cannot be shared between threads safely
// ERROR resource proxies are not `Send`able across tasks
is_send(&r.SHARED);
is_send(&ctxt.resources.SHARED);
//~^ error the trait bound `*const (): core::marker::Send` is not satisfied
}
fn exti1(_t: &mut Threshold, _r: EXTI1::Resources) {
}
fn exti1(_ctxt: exti1::Context) {}