Files
Dan Gohman 645e05f465 Enable CpuSet::count on Android (#204)
* Enable `CpuSet::count` on Android.
2022-01-31 09:08:09 -08:00

15 lines
330 B
Rust

#[cfg(any(target_os = "android", target_os = "linux"))]
#[test]
fn test_cpu_set() {
let set = rustix::process::sched_getaffinity(None).unwrap();
let mut count = 0;
for i in 0..rustix::process::CpuSet::MAX_CPU {
if set.is_set(i) {
count += 1;
}
}
assert_eq!(count, set.count());
}