Skip to content

Commit 9bcb2d9

Browse files
author
Oli Iliffe
committed
Add test for available_parallelism()
This is a redo of (this PR)[rust-lang#104095]. Add test for available_parallelism Add test for available_parallelism Add test for Add test for
1 parent b3d4fde commit 9bcb2d9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

std/tests/thread.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,21 @@ fn thread_local_containing_const_statements() {
3737
assert_eq!(CELL.get(), 1);
3838
assert_eq!(REFCELL.take(), 1);
3939
}
40+
41+
#[test]
42+
// Include an ignore list on purpose, so that new platforms don't miss it
43+
#[cfg_attr(
44+
any(
45+
target_os = "redox",
46+
target_os = "l4re",
47+
target_env = "sgx",
48+
target_os = "solid_asp3",
49+
target_os = "teeos",
50+
target_os = "wasi"
51+
),
52+
should_panic
53+
)]
54+
fn available_parallelism() {
55+
// check that std::thread::available_parallelism() returns a valid value
56+
assert!(thread::available_parallelism().is_ok());
57+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy