mirror of
https://github.com/openharmony/third_party_rust_rustix.git
synced 2026-07-21 18:25:30 -04:00
645e05f465
* Enable `CpuSet::count` on Android.
15 lines
330 B
Rust
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());
|
|
}
|