diff options
author | Steve Hay <steve.m.hay@googlemail.com> | 2014-11-13 14:14:17 +0000 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2014-11-13 14:14:17 +0000 |
commit | ab4b56a0c627ff9082ef9abe554ca6a68e83ac46 (patch) | |
tree | 9c16577b4157af89703f6c0ca248629a97eeae93 /t | |
parent | b5fefeb7f70bf9f53f884e481627c7d76ad38e5f (diff) | |
download | perl-libnet-ab4b56a0c627ff9082ef9abe554ca6a68e83ac46.tar.gz |
No need to repeat checks for IO::Socket::SSL in t/*_ssl.t
We have already skipped all tests if !can_ssl() so there is no need to repeat what it checks. Nor is there any need to test if IO::Socket::SSL::Utils can be loaded and contains a required function: We can safely assume this is true if we've already checked that a suitable version of IO::Socket::SSL is available. All we need to do is to actually load IO::Socket::SSL::Utils since IO::Socket::SSL doesn't load it itself.
Diffstat (limited to 't')
-rw-r--r-- | t/nntp_ssl.t | 4 | ||||
-rw-r--r-- | t/pop3_ssl.t | 8 | ||||
-rw-r--r-- | t/smtp_ssl.t | 8 |
3 files changed, 3 insertions, 17 deletions
diff --git a/t/nntp_ssl.t b/t/nntp_ssl.t index 55cdc16..66789fb 100644 --- a/t/nntp_ssl.t +++ b/t/nntp_ssl.t @@ -22,9 +22,6 @@ plan skip_all => "fork not supported on this platform" $Config::Config{useithreads} and $Config::Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/); -plan skip_all => "incomplete or version of IO::Socket::SSL" - if ! eval { require IO::Socket::SSL::Utils }; - my $srv = IO::Socket::INET->new( LocalAddr => '127.0.0.1', Listen => 10 @@ -35,6 +32,7 @@ my $port = $srv->sockport; plan tests => 2; +require IO::Socket::SSL::Utils; my ($ca,$key) = IO::Socket::SSL::Utils::CERT_create( CA => 1 ); my ($fh,$cafile) = tempfile(); print $fh IO::Socket::SSL::Utils::PEM_cert2string($ca); diff --git a/t/pop3_ssl.t b/t/pop3_ssl.t index 2d02331..31b2bbd 100644 --- a/t/pop3_ssl.t +++ b/t/pop3_ssl.t @@ -22,13 +22,6 @@ plan skip_all => "fork not supported on this platform" $Config::Config{useithreads} and $Config::Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/); -plan skip_all => "incomplete or to old version of IO::Socket::SSL" if ! eval { - require IO::Socket::SSL - && IO::Socket::SSL->VERSION(1.999) - && require IO::Socket::SSL::Utils - && defined &IO::Socket::SSL::Utils::CERT_create; -}; - my $srv = IO::Socket::INET->new( LocalAddr => '127.0.0.1', Listen => 10 @@ -38,6 +31,7 @@ my $saddr = $srv->sockhost.':'.$srv->sockport; plan tests => 2; +require IO::Socket::SSL::Utils; my ($ca,$key) = IO::Socket::SSL::Utils::CERT_create( CA => 1 ); my ($fh,$cafile) = tempfile(); print $fh IO::Socket::SSL::Utils::PEM_cert2string($ca); diff --git a/t/smtp_ssl.t b/t/smtp_ssl.t index 3686eb6..108d094 100644 --- a/t/smtp_ssl.t +++ b/t/smtp_ssl.t @@ -22,13 +22,6 @@ plan skip_all => "fork not supported on this platform" $Config::Config{useithreads} and $Config::Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/); -plan skip_all => "incomplete or to old version of IO::Socket::SSL" if ! eval { - require IO::Socket::SSL - && IO::Socket::SSL->VERSION(1.999) - && require IO::Socket::SSL::Utils - && defined &IO::Socket::SSL::Utils::CERT_create; -}; - my $srv = IO::Socket::INET->new( LocalAddr => '127.0.0.1', Listen => 10 @@ -38,6 +31,7 @@ my $saddr = $srv->sockhost.':'.$srv->sockport; plan tests => 2; +require IO::Socket::SSL::Utils; my ($ca,$key) = IO::Socket::SSL::Utils::CERT_create( CA => 1 ); my ($fh,$cafile) = tempfile(); print $fh IO::Socket::SSL::Utils::PEM_cert2string($ca); |