mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 18:03:25 +00:00
OSDK check and clippy with cfg(ktest)
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
be3492d7f0
commit
d76c7a5b1e
@ -119,6 +119,7 @@ mod test {
|
||||
use crate::prelude::*;
|
||||
|
||||
#[ktest]
|
||||
#[allow(clippy::eq_op)]
|
||||
fn trivial_assertion() {
|
||||
assert_eq!(0, 0);
|
||||
}
|
||||
|
@ -334,9 +334,10 @@ mod test {
|
||||
.alloc_contiguous()
|
||||
.unwrap();
|
||||
let vm_segment_child = vm_segment_parent.range(0..1);
|
||||
let _dma_stream_parent =
|
||||
let dma_stream_parent =
|
||||
DmaStream::map(vm_segment_parent, DmaDirection::Bidirectional, false);
|
||||
let dma_stream_child = DmaStream::map(vm_segment_child, DmaDirection::Bidirectional, false);
|
||||
assert!(dma_stream_parent.is_ok());
|
||||
assert!(dma_stream_child.is_err());
|
||||
}
|
||||
|
||||
|
@ -313,24 +313,24 @@ mod test {
|
||||
fn set_get() {
|
||||
let bits = AtomicBits::new_zeroes(128);
|
||||
for i in 0..bits.len() {
|
||||
assert!(bits.get(i) == false);
|
||||
assert!(!bits.get(i));
|
||||
|
||||
bits.set(i, true);
|
||||
assert!(bits.get(i) == true);
|
||||
assert!(bits.get(i));
|
||||
|
||||
bits.set(i, false);
|
||||
assert!(bits.get(i) == false);
|
||||
assert!(!bits.get(i));
|
||||
}
|
||||
|
||||
let bits = AtomicBits::new_ones(128);
|
||||
for i in 0..bits.len() {
|
||||
assert!(bits.get(i) == true);
|
||||
assert!(bits.get(i));
|
||||
|
||||
bits.set(i, false);
|
||||
assert!(bits.get(i) == false);
|
||||
assert!(!bits.get(i));
|
||||
|
||||
bits.set(i, true);
|
||||
assert!(bits.get(i) == true);
|
||||
assert!(bits.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
@ -389,9 +389,9 @@ mod test {
|
||||
#[ktest]
|
||||
fn iter() {
|
||||
let bits = AtomicBits::new_zeroes(7);
|
||||
assert!(bits.iter().all(|bit| bit == false));
|
||||
assert!(bits.iter().all(|bit| !bit));
|
||||
|
||||
let bits = AtomicBits::new_ones(128);
|
||||
assert!(bits.iter().all(|bit| bit == true));
|
||||
assert!(bits.iter().all(|bit| bit));
|
||||
}
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ mod test {
|
||||
Task::yield_now();
|
||||
|
||||
cond_cloned.store(true, Ordering::Relaxed);
|
||||
wake(&*queue_cloned);
|
||||
wake(&queue_cloned);
|
||||
})
|
||||
.data(())
|
||||
.spawn()
|
||||
|
@ -383,6 +383,7 @@ mod test {
|
||||
|
||||
#[ktest]
|
||||
fn create_task() {
|
||||
#[allow(clippy::eq_op)]
|
||||
let task = || {
|
||||
assert_eq!(1, 1);
|
||||
};
|
||||
@ -395,6 +396,7 @@ mod test {
|
||||
|
||||
#[ktest]
|
||||
fn spawn_task() {
|
||||
#[allow(clippy::eq_op)]
|
||||
let task = || {
|
||||
assert_eq!(1, 1);
|
||||
};
|
||||
|
Reference in New Issue
Block a user