Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions tests/by-util/test_nice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// spell-checker:ignore libc's setpriority
// spell-checker:ignore getpriority setpriority
use uutests::new_ucmd;

#[test]
#[cfg(not(target_os = "android"))]
fn test_get_current_niceness() {
// Test that the nice command with no arguments returns the default nice
// value, which we determine by querying libc's `nice` in our own process.
new_ucmd!()
.succeeds()
.stdout_is(format!("{}\n", unsafe { libc::nice(0) }));
// Test that the nice command with no arguments returns the default nice value
let nice = rustix::process::getpriority_process(None).unwrap();
new_ucmd!().succeeds().stdout_is(format!("{nice}\n"));
}

#[test]
Expand Down
Loading