X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=dev%2Fi386%2Flibnet-ssleay-perl%2Flibnet-ssleay-perl-1.35%2Ft%2Flocal%2F15_bio.t;fp=dev%2Fi386%2Flibnet-ssleay-perl%2Flibnet-ssleay-perl-1.35%2Ft%2Flocal%2F15_bio.t;h=20f72c907435b165f1e384eb070198891bc30fd6;hb=8977e561d8a9eae6959218b0306c9df2056a38a9;hp=0000000000000000000000000000000000000000;hpb=df794b845212301ea0d267c919232538bfef356a;p=dh-make-perl diff --git a/dev/i386/libnet-ssleay-perl/libnet-ssleay-perl-1.35/t/local/15_bio.t b/dev/i386/libnet-ssleay-perl/libnet-ssleay-perl-1.35/t/local/15_bio.t new file mode 100644 index 0000000..20f72c9 --- /dev/null +++ b/dev/i386/libnet-ssleay-perl/libnet-ssleay-perl-1.35/t/local/15_bio.t @@ -0,0 +1,21 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use Test::More tests => 7; +use Net::SSLeay; + +my $data = '0123456789' x 100; +my $len = length $data; + +ok( my $bio = Net::SSLeay::BIO_new( &Net::SSLeay::BIO_s_mem ), 'BIO_new' ); +is( Net::SSLeay::BIO_write($bio, $data), $len, 'BIO_write' ); +is( Net::SSLeay::BIO_pending($bio), $len, 'BIO_pending' ); + +my $read_len = 9; +is( Net::SSLeay::BIO_read($bio, $read_len), substr($data, 0, $read_len), 'BIO_read part' ); +is( Net::SSLeay::BIO_pending($bio), $len - $read_len, 'BIO_pending' ); + +is( Net::SSLeay::BIO_read($bio), substr($data, $read_len), 'BIO_read rest' ); + +ok( Net::SSLeay::BIO_free($bio), 'BIO_free' );