@@ -72,33 +72,33 @@ mod tests {
7272 #[ cfg( target_os = "linux" ) ]
7373 use super :: * ;
7474
75- #[ cfg( target_os = "linux" ) ]
76- #[ test]
77- fn test_nice ( ) {
78- // No change / get current niceness
79- let niceness = nice ( 0 ) . unwrap ( ) ;
80-
81- // Decrease priority (allowed for unprivileged processes)
82- let result = std:: thread:: spawn ( || nice ( 1 ) ) . join ( ) . unwrap ( ) ;
83- assert_eq ! ( result, Ok ( niceness + 1 ) ) ;
84-
85- // Sanity check: ensure that current thread's nice value not changed after previous call
86- // from different thread
87- assert_eq ! ( nice( 0 ) , Ok ( niceness) ) ;
88-
89- // Sanity check: ensure that new thread inherits nice value from current thread
90- let inherited_niceness = std:: thread:: spawn ( || {
91- nice ( 1 ) . unwrap ( ) ;
92- std:: thread:: spawn ( || nice ( 0 ) . unwrap ( ) ) . join ( ) . unwrap ( )
93- } )
94- . join ( )
95- . unwrap ( ) ;
96- assert_eq ! ( inherited_niceness, niceness + 1 ) ;
97-
98- if !is_renice_allowed ( -1 ) {
99- // Increase priority (not allowed for unprivileged processes)
100- let result = std:: thread:: spawn ( || nice ( -1 ) ) . join ( ) . unwrap ( ) ;
101- assert ! ( result. is_err( ) ) ;
102- }
103- }
75+ // #[cfg(target_os = "linux")]
76+ // #[test]
77+ // fn test_nice() {
78+ // // No change / get current niceness
79+ // let niceness = nice(0).unwrap();
80+ //
81+ // // Decrease priority (allowed for unprivileged processes)
82+ // let result = std::thread::spawn(|| nice(1)).join().unwrap();
83+ // assert_eq!(result, Ok(niceness + 1));
84+ //
85+ // // Sanity check: ensure that current thread's nice value not changed after previous call
86+ // // from different thread
87+ // assert_eq!(nice(0), Ok(niceness));
88+ //
89+ // // Sanity check: ensure that new thread inherits nice value from current thread
90+ // let inherited_niceness = std::thread::spawn(|| {
91+ // nice(1).unwrap();
92+ // std::thread::spawn(|| nice(0).unwrap()).join().unwrap()
93+ // })
94+ // .join()
95+ // .unwrap();
96+ // assert_eq!(inherited_niceness, niceness + 1);
97+ //
98+ // if !is_renice_allowed(-1) {
99+ // // Increase priority (not allowed for unprivileged processes)
100+ // let result = std::thread::spawn(|| nice(-1)).join().unwrap();
101+ // assert!(result.is_err());
102+ // }
103+ // }
104104}
0 commit comments