Skip to content

Commit 4ee0c8d

Browse files
committed
cleanup some test cfg
1 parent e1dd14e commit 4ee0c8d

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

tests/pass-dep/shims/libc-misc.rs

+10-12
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn test_posix_realpath_errors() {
8787
assert_eq!(e.kind(), ErrorKind::NotFound);
8888
}
8989

90-
#[cfg(any(target_os = "linux"))]
90+
#[cfg(target_os = "linux")]
9191
fn test_posix_fadvise() {
9292
use std::convert::TryInto;
9393
use std::io::Write;
@@ -115,7 +115,7 @@ fn test_posix_fadvise() {
115115
assert_eq!(result, 0);
116116
}
117117

118-
#[cfg(any(target_os = "linux"))]
118+
#[cfg(target_os = "linux")]
119119
fn test_sync_file_range() {
120120
use std::io::Write;
121121

@@ -181,7 +181,7 @@ fn test_thread_local_errno() {
181181
}
182182

183183
/// Tests whether clock support exists at all
184-
#[cfg(any(target_os = "linux"))]
184+
#[cfg(target_os = "linux")]
185185
fn test_clocks() {
186186
let mut tp = std::mem::MaybeUninit::<libc::timespec>::uninit();
187187
let is_error = unsafe { libc::clock_gettime(libc::CLOCK_REALTIME, tp.as_mut_ptr()) };
@@ -283,23 +283,21 @@ fn test_posix_mkstemp() {
283283
}
284284

285285
fn main() {
286-
#[cfg(any(target_os = "linux"))]
287-
test_posix_fadvise();
288-
289286
test_posix_gettimeofday();
290287
test_posix_mkstemp();
291288

292289
test_posix_realpath_alloc();
293290
test_posix_realpath_noalloc();
294291
test_posix_realpath_errors();
295292

296-
#[cfg(any(target_os = "linux"))]
297-
test_sync_file_range();
298-
299293
test_thread_local_errno();
300294

301-
#[cfg(any(target_os = "linux"))]
302-
test_clocks();
303-
304295
test_isatty();
296+
297+
#[cfg(target_os = "linux")]
298+
{
299+
test_posix_fadvise();
300+
test_sync_file_range();
301+
test_clocks();
302+
}
305303
}

tests/pass-dep/shims/pthreads.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn main() {
1010
test_rwlock_libc_static_initializer();
1111
test_named_thread_truncation();
1212

13-
#[cfg(any(target_os = "linux"))]
13+
#[cfg(target_os = "linux")]
1414
test_mutex_libc_static_initializer_recursive();
1515
}
1616

0 commit comments

Comments
 (0)