summaryrefslogtreecommitdiff
path: root/t/io
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2019-02-20 10:57:19 +1100
committerTony Cook <tony@develop-help.com>2019-02-20 10:57:19 +1100
commit2e51033c15c9a62065f9d7f20df90faa02d058fc (patch)
tree7d104145ec315095ee3e6f19b0a3c77bca65cbbb /t/io
parent125ddee8ebdbac0f8fe3618e922198189bc47825 (diff)
downloadperl-2e51033c15c9a62065f9d7f20df90faa02d058fc.tar.gz
test for error set on socket() failure
Diffstat (limited to 't/io')
-rw-r--r--t/io/socket.t12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/io/socket.t b/t/io/socket.t
index be3abc0e1e..2dce1a7d08 100644
--- a/t/io/socket.t
+++ b/t/io/socket.t
@@ -44,6 +44,18 @@ my $fork = $Config{d_fork} || $Config{d_pseudofork};
ok(close($sock), "close the socket");
}
+SKIP:
+{
+ $udp
+ or skip "No udp", 1;
+ # [perl #133853] failed socket creation didn't set error
+ # for bad parameters on Win32
+ $! = 0;
+ socket(my $sock, PF_INET, SOCK_STREAM, $udp)
+ and skip "managed to make a UDP stream socket", 1;
+ ok(0+$!, "error set on failed socket()");
+}
+
SKIP: {
# test it all in TCP
$local or skip("No localhost", 3);