Fix tests.
This commit is contained in:
@ -169,4 +169,4 @@ wasm-timer = { version = "0.2.5", optional = true }
|
||||
[dev-dependencies]
|
||||
serial_test = "0.9"
|
||||
critical-section = { version = "1.1", features = ["std"] }
|
||||
|
||||
embassy-executor = { version = "0.2.0", path = "../embassy-executor", features = ["nightly"] }
|
||||
|
@ -49,7 +49,7 @@
|
||||
//! fn set_alarm_callback(&self, alarm: AlarmHandle, callback: fn(*mut ()), ctx: *mut ()) {
|
||||
//! todo!()
|
||||
//! }
|
||||
//! fn set_alarm(&self, alarm: AlarmHandle, timestamp: u64) {
|
||||
//! fn set_alarm(&self, alarm: AlarmHandle, timestamp: u64) -> bool {
|
||||
//! todo!()
|
||||
//! }
|
||||
//! }
|
||||
|
@ -183,7 +183,6 @@ mod tests {
|
||||
|
||||
use serial_test::serial;
|
||||
|
||||
use super::InnerQueue;
|
||||
use crate::driver::{AlarmHandle, Driver};
|
||||
use crate::queue_generic::QUEUE;
|
||||
use crate::Instant;
|
||||
@ -317,14 +316,18 @@ mod tests {
|
||||
|
||||
fn setup() {
|
||||
DRIVER.reset();
|
||||
|
||||
QUEUE.inner.lock(|inner| {
|
||||
*inner.borrow_mut() = InnerQueue::new();
|
||||
});
|
||||
critical_section::with(|cs| *QUEUE.inner.borrow_ref_mut(cs) = None);
|
||||
}
|
||||
|
||||
fn queue_len() -> usize {
|
||||
QUEUE.inner.lock(|inner| inner.borrow().queue.iter().count())
|
||||
critical_section::with(|cs| {
|
||||
QUEUE
|
||||
.inner
|
||||
.borrow_ref(cs)
|
||||
.as_ref()
|
||||
.map(|inner| inner.queue.iter().count())
|
||||
.unwrap_or(0)
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -109,7 +109,6 @@ impl Future for Timer {
|
||||
/// # #![feature(type_alias_impl_trait)]
|
||||
/// #
|
||||
/// use embassy_time::{Duration, Ticker};
|
||||
/// use futures::StreamExt;
|
||||
/// # fn foo(){}
|
||||
///
|
||||
/// #[embassy_executor::task]
|
||||
|
Reference in New Issue
Block a user