dougm 01/04/02 02:04:28 Added: t/response/TestAPR lib.pm netlib.pm uuid.pm Log: start of apr tests Revision Changes Path 1.1 modperl-2.0/t/response/TestAPR/lib.pm Index: lib.pm =================================================================== package TestAPR::lib; use strict; use warnings FATAL => 'all'; use Apache::Test; use APR::Lib (); sub handler { my $r = shift; plan $r, tests => 3; my $blen = 10; my $bytes = APR::generate_random_bytes(10); ok length($bytes) == $blen; my $status = APR::password_validate("one", "two"); ok $status != 0; my $str= APR::strerror($status); print "strerror=$str\n"; ok $str eq 'passwords do not match'; 0; } 1; 1.1 modperl-2.0/t/response/TestAPR/netlib.pm Index: netlib.pm =================================================================== package TestAPR::netlib; use strict; use warnings FATAL => 'all'; use Apache::Test; use APR::NetLib (); sub handler { my $r = shift; my $c = $r->connection; my $p = $r->pool; plan $r, tests => 3; my $ip = $c->remote_ip; ok $ip; my $ipsub = APR::IpSubnet->new($p, $ip); ok $ipsub->test($c->remote_addr); $ipsub = APR::IpSubnet->new($p, scalar reverse $ip); ok ! $ipsub->test($c->remote_addr); 0; } 1; 1.1 modperl-2.0/t/response/TestAPR/uuid.pm Index: uuid.pm =================================================================== package TestAPR::uuid; use strict; use warnings FATAL => 'all'; use Apache::Test; use APR::UUID (); sub handler { my $r = shift; plan $r, tests => 3; my $uuid = APR::UUID->new->format; ok $uuid; my $uuid_parsed = APR::UUID->parse($uuid); ok $uuid_parsed; ok $uuid eq $uuid_parsed->format; 0; } 1;