From 470d7b2823bebfd93d530d33fbe504869b3bdb20 Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Mon, 2 Jun 2014 13:54:53 +0100 Subject: Avoid "Name "IO::Socket::SSL::SSL_ERROR" used only once: possible typo" warnings --- t/external/pop3-ssl.t | 3 +++ t/external/smtp-ssl.t | 3 +++ t/pop3_ssl.t | 1 + t/smtp_ssl.t | 1 + 4 files changed, 8 insertions(+) diff --git a/t/external/pop3-ssl.t b/t/external/pop3-ssl.t index 585890c..6eec93c 100644 --- a/t/external/pop3-ssl.t +++ b/t/external/pop3-ssl.t @@ -8,10 +8,13 @@ my $host = 'pop.gmx.net'; my $debug = 0; plan skip_all => "no SSL support" if ! Net::POP3->can_ssl; +{ +no warnings 'once'; plan skip_all => "no verified SSL connection to $host:995 - $@" if ! eval { IO::Socket::SSL->new(PeerAddr => "$host:995", Timeout => 10) || die($IO::Socket::SSL::SSL_ERROR||$!); }; +} plan tests => 2; diff --git a/t/external/smtp-ssl.t b/t/external/smtp-ssl.t index 94753ab..1802976 100644 --- a/t/external/smtp-ssl.t +++ b/t/external/smtp-ssl.t @@ -8,10 +8,13 @@ my $host = 'mail.gmx.net'; my $debug = 0; plan skip_all => "no SSL support" if ! Net::SMTP->can_ssl; +{ +no warnings 'once'; plan skip_all => "no verified SSL connection to $host:465 - $@" if ! eval { IO::Socket::SSL->new("$host:465") || die($IO::Socket::SSL::SSL_ERROR||$!); }; +} plan tests => 2; diff --git a/t/pop3_ssl.t b/t/pop3_ssl.t index f1090af..eec1730 100644 --- a/t/pop3_ssl.t +++ b/t/pop3_ssl.t @@ -69,6 +69,7 @@ sub pop3_client { $cl->quit; pass("SSL POP3 connect success"); } elsif ( ! $cl->starttls ) { + no warnings 'once'; fail("starttls failed: $IO::Socket::SSL::SSL_ERROR"); } else { $cl->quit; diff --git a/t/smtp_ssl.t b/t/smtp_ssl.t index afb7bee..e4cc918 100644 --- a/t/smtp_ssl.t +++ b/t/smtp_ssl.t @@ -69,6 +69,7 @@ sub smtp_client { $cl->quit; pass("SSL SMTP connect success"); } elsif ( ! $cl->starttls ) { + no warnings 'once'; fail("starttls failed: $IO::Socket::SSL::SSL_ERROR"); } else { $cl->quit; -- cgit v1.2.3-24-ge0c7