From: Shane Lontis Date: Wed, 15 Jul 2020 01:49:57 +0000 (+1000) Subject: Fix trailing whitespace mismatch error when running 02-test_errstr. X-Git-Tag: openssl-3.0.0-alpha6~111 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e78da06660b269fbdf8faba6bc3a356ee3fda5e;p=thirdparty%2Fopenssl.git Fix trailing whitespace mismatch error when running 02-test_errstr. Fixes #12449 On a aix7_ppc32 machine the error was of the form match 'Previous owner died ' (2147483743) with one of ( 'Previous owner died', 'reason(95)' ) Stripping the trailing whitespace from the system error will address this issue. Suggested fix by @pauldale. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/12451) --- diff --git a/test/recipes/02-test_errstr.t b/test/recipes/02-test_errstr.t index a63812f3970..7c382b41240 100644 --- a/test/recipes/02-test_errstr.t +++ b/test/recipes/02-test_errstr.t @@ -49,7 +49,7 @@ use constant ERR_LIB_NONE => 1; plan tests => scalar @Errno::EXPORT_OK +1 # Checking that error 128 gives 'reason(128)' +1 # Checking that error 0 gives the library name - ; + +1; # Check trailing whitespace is removed. # Test::More:ok() has a sub prototype, which means we need to use the '&ok' # syntax to force it to accept a list as a series of arguments. @@ -66,6 +66,7 @@ foreach my $errname (@Errno::EXPORT_OK) { # Reason code 0 of any library gives the library name as reason &ok(match_opensslerr_reason(ERR_LIB_NONE << ERR_LIB_OFFSET | 0, "unknown library")); +&ok(match_any("Trailing whitespace \n\t", "?", ( "Trailing whitespace" ))); exit 0; @@ -93,6 +94,9 @@ sub match_any { my $desc = shift; my @strings = @_; + # ignore trailing whitespace + $first =~ s/\s+$//; + if (scalar @strings > 1) { $desc = "match '$first' ($desc) with one of ( '" . join("', '", @strings) . "' )";