mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
expr: fix crash for test_long_input on OpenBSD
Signed-off-by: Laurent Cheylus <foxy@free.fr>
This commit is contained in:
parent
0fabf825e1
commit
6130a334f2
1 changed files with 8 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue