Codebase list openssl / 0e1b0e5
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) Richard Levitte 5 years ago
1 changed file(s) with 37 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3737 # (this is documented)
3838 my @posix_errors = @{$Errno::EXPORT_TAGS{POSIX}};
3939
40 if ($^O eq 'MSWin32') {
41 # On Windows, these errors have been observed to not always be loaded by
42 # apps/openssl, while they are in perl, which causes a difference that we
43 # consider a false alarm. So we skip checking these errors.
44 # Because we can't know exactly what symbols exist in a perticular perl
45 # version, we resort to discovering them directly in the Errno package
46 # symbol table.
47 my @error_skiplist = qw(
48 ENETDOWN
49 ENETUNREACH
50 ENETRESET
51 ECONNABORTED
52 EISCONN
53 ENOTCONN
54 ESHUTDOWN
55 ETOOMANYREFS
56 ETIMEDOUT
57 EHOSTDOWN
58 EHOSTUNREACH
59 EALREADY
60 EINPROGRESS
61 ESTALE
62 EUCLEAN
63 ENOTNAM
64 ENAVAIL
65 ENOMEDIUM
66 ENOKEY
67 );
68 @posix_errors =
69 grep {
70 my $x = $_;
71 ! grep {
72 exists $Errno::{$_} && $x == $Errno::{$_}
73 } @error_skiplist
74 } @posix_errors;
75 }
76
4077 plan tests => scalar @posix_errors
4178 +1 # Checking that error 128 gives 'reason(128)'
4279 +1 # Checking that error 0 gives the library name