make the test-swapper crate kick out NOCOPY data

makes the test case more comprehensive
This commit is contained in:
bunnie 2024-04-07 18:56:40 +08:00
parent f2a8603e55
commit 49f3570d23

View file

@ -1,8 +1,12 @@
use std::sync::atomic::{AtomicU32, Ordering};
use std::thread::sleep;
use std::time::Duration;
use log::info;
// put here to force a .sbss/.bss section for loader testing
static mut LOOP_COUNT: AtomicU32 = AtomicU32::new(0);
fn main() -> ! {
log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Trace);
@ -11,7 +15,8 @@ fn main() -> ! {
const DELAY_MS: u64 = 2000;
for i in 0.. {
info!("Loop #{}, waiting {} ms", i, DELAY_MS);
unsafe { LOOP_COUNT.store(i, Ordering::SeqCst) };
info!("Loop #{}, waiting {} ms", unsafe { LOOP_COUNT.load(Ordering::SeqCst) }, DELAY_MS);
sleep(Duration::from_millis(DELAY_MS));
}