1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #4783 from sunfishcode/sunfishcode/default-nice

Avoid spurious failures in the presence of non-zero default nice
This commit is contained in:
Sylvestre Ledru 2023-04-26 22:46:37 +02:00 committed by GitHub
commit 5a7eb5b3a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,11 +1,14 @@
// spell-checker:ignore libc's
use crate::common::util::TestScenario; use crate::common::util::TestScenario;
#[test] #[test]
#[cfg(not(target_os = "android"))] #[cfg(not(target_os = "android"))]
fn test_get_current_niceness() { fn test_get_current_niceness() {
// NOTE: this assumes the test suite is being run with a default niceness // Test that the nice command with no arguments returns the default nice
// of 0, which may not necessarily be true // value, which we determine by querying libc's `nice` in our own process.
new_ucmd!().run().stdout_is("0\n"); new_ucmd!()
.run()
.stdout_is(format!("{}\n", unsafe { libc::nice(0) }));
} }
#[test] #[test]