aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-01-25 23:57:09 +0100
committerRichard Levitte <levitte@openssl.org>2019-02-11 16:30:48 +0100
commit6e68f244f48bd7118b9262ff5905da1c3b15cae9 (patch)
treec2271654b5f0d60f876bee6e1edfc62a0dfb357d
parent61db9961417e74cbd4a285fe482f1f2b30c5536b (diff)
downloadopenssl-6e68f244f48bd7118b9262ff5905da1c3b15cae9.zip
openssl-6e68f244f48bd7118b9262ff5905da1c3b15cae9.tar.gz
openssl-6e68f244f48bd7118b9262ff5905da1c3b15cae9.tar.bz2
test/recipes/02-err_errstr: skip errors that may not be loaded on Windows
Fixes #8091 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8094) (cherry picked from commit 0e1b0e510dfe078b3fb2586d987d7b49ff8ef0b2)
-rw-r--r--test/recipes/02-test_errstr.t37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/recipes/02-test_errstr.t b/test/recipes/02-test_errstr.t
index ce2792b..a9e8ed4 100644
--- a/test/recipes/02-test_errstr.t
+++ b/test/recipes/02-test_errstr.t
@@ -38,6 +38,43 @@ plan skip_all => 'OpenSSL is configured "no-autoerrinit" or "no-err"'
# (this is documented)
my @posix_errors = @{$Errno::EXPORT_TAGS{POSIX}};
+if ($^O eq 'MSWin32') {
+ # On Windows, these errors have been observed to not always be loaded by
+ # apps/openssl, while they are in perl, which causes a difference that we
+ # consider a false alarm. So we skip checking these errors.
+ # Because we can't know exactly what symbols exist in a perticular perl
+ # version, we resort to discovering them directly in the Errno package
+ # symbol table.
+ my @error_skiplist = qw(
+ ENETDOWN
+ ENETUNREACH
+ ENETRESET
+ ECONNABORTED
+ EISCONN
+ ENOTCONN
+ ESHUTDOWN
+ ETOOMANYREFS
+ ETIMEDOUT
+ EHOSTDOWN
+ EHOSTUNREACH
+ EALREADY
+ EINPROGRESS
+ ESTALE
+ EUCLEAN
+ ENOTNAM
+ ENAVAIL
+ ENOMEDIUM
+ ENOKEY
+ );
+ @posix_errors =
+ grep {
+ my $x = $_;
+ ! grep {
+ exists $Errno::{$_} && $x == $Errno::{$_}
+ } @error_skiplist
+ } @posix_errors;
+}
+
plan tests => scalar @posix_errors
+1 # Checking that error 128 gives 'reason(128)'
+1 # Checking that error 0 gives the library name