mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
expr: fix crash for test_long_input on OpenBSD
Signed-off-by: Laurent Cheylus <foxy@free.fr>
This commit is contained in:
@@ -582,11 +582,17 @@ fn test_eager_evaluation() {
|
||||
#[test]
|
||||
fn test_long_input() {
|
||||
// Giving expr an arbitrary long expression should succeed rather than end with a segfault due to a stack overflow.
|
||||
#[cfg(not(windows))]
|
||||
#[cfg(all(not(windows), not(target_os = "openbsd")))]
|
||||
const MAX_NUMBER: usize = 40000;
|
||||
#[cfg(not(windows))]
|
||||
#[cfg(all(not(windows), not(target_os = "openbsd")))]
|
||||
const RESULT: &str = "800020000\n";
|
||||
|
||||
// On OpenBSD, crash with default MAX_NUMBER
|
||||
#[cfg(target_os = "openbsd")]
|
||||
const MAX_NUMBER: usize = 10000;
|
||||
#[cfg(target_os = "openbsd")]
|
||||
const RESULT: &str = "50005000\n";
|
||||
|
||||
// On windows there is 8192 characters input limit
|
||||
#[cfg(windows)]
|
||||
const MAX_NUMBER: usize = 1300; // 7993 characters (with spaces)
|
||||
|
||||
Reference in New Issue
Block a user