Permalink
Browse files

small details

Signed-off-by: Alexei Znamensky <russoz@cpan.org>
  • Loading branch information...
1 parent 4ec0095 commit 0ecb36280bd128ae949b6aafde306772374a4b5c @russoz committed Jul 31, 2011
Showing with 8 additions and 40 deletions.
  1. +0 −9 t/01-load-handler.t
  2. +0 −9 t/01-load-store.t
  3. +0 −2 t/03-param.t
  4. +8 −20 t/04-bind.t
View
@@ -1,9 +0,0 @@
-use Test::More tests => 1;
-
-BEGIN {
- use_ok('Net::LDAP::SimpleServer::ProtocolHandler');
-}
-
-diag(
-"Testing Net::LDAP::SimpleServer::ProtocolHandler $Net::LDAP::SimpleServer::ProtocolHandler::VERSION"
-);
View
@@ -1,9 +0,0 @@
-use Test::More tests => 1;
-
-BEGIN {
- use_ok('Net::LDAP::SimpleServer::LDIFStore');
-}
-
-diag(
-"Testing Net::LDAP::SimpleServer::LDIFStore $Net::LDAP::SimpleServer::LDIFStore::VERSION"
-);
View
@@ -27,7 +27,6 @@ sub _eval_param {
# work with Net::Server, thus we pass them in run()
my $s = Net::LDAP::SimpleServer->new();
- diag('Starting Net::LDAP::SimpleServer [Fork]');
$s->run(@a);
};
@@ -45,7 +44,6 @@ sub _eval_param {
diag('Testing the constructor params for SimpleServer');
-# ===========================================================================
# expect failure
ok( !_eval_param() );
ok( !_eval_param( {} ) );
View
@@ -15,57 +15,45 @@ use constant TESTROOTPW => 'testpw';
#sub diag { print STDERR @_; }
sub ldapconnect {
-
- #diag( 'Connecting to server ' . TESTHOST . ':' . TESTPORT );
return Net::LDAP->new( TESTHOST, port => TESTPORT );
}
sub run_test {
my $mesg = undef;
my $ldap = ldapconnect();
-
- #print STDERR 'ldap :: ' . Dumper($ldap);
ok($ldap);
diag('Performing an anonymous bind');
$mesg = $ldap->bind;
- diag( $mesg->error_desc ) if $mesg->code;
- ok( !$mesg->code );
+ ok( !$mesg->code, $mesg->error_desc );
$mesg = $ldap->unbind;
- diag( $mesg->error_desc ) if $mesg->code;
- ok( !$mesg->code );
+ ok( !$mesg->code, $mesg->error_desc );
diag('Performing an authenticated bind');
$ldap = ldapconnect();
$mesg = $ldap->bind( TESTROOTDN, password => TESTROOTPW );
- diag( $mesg->error_desc ) if $mesg->code;
- ok( !$mesg->code );
+ ok( !$mesg->code, $mesg->error_desc );
$mesg = $ldap->unbind;
- diag( $mesg->error_desc ) if $mesg->code;
- ok( !$mesg->code );
+ ok( !$mesg->code, $mesg->error_desc );
diag('Performing an authenticated bind, upper case DN');
$ldap = ldapconnect();
$mesg = $ldap->bind( uc(TESTROOTDN), password => TESTROOTPW );
- diag( $mesg->error_desc ) if $mesg->code;
- ok( !$mesg->code );
+ ok( !$mesg->code, $mesg->error_desc );
$mesg = $ldap->unbind;
- diag( $mesg->error_desc ) if $mesg->code;
- ok( !$mesg->code );
+ ok( !$mesg->code, $mesg->error_desc );
diag('Performing an authenticated bind with wrong password');
$ldap = ldapconnect();
$mesg = $ldap->bind( TESTROOTDN, password => 'some-wrong-password' );
- diag( $mesg->error_desc ) if $mesg->code;
- ok( $mesg->code );
+ ok( $mesg->code, $mesg->error_desc );
$mesg = $ldap->unbind;
- diag( $mesg->error_desc ) if $mesg->code;
- ok( !$mesg->code );
+ ok( !$mesg->code, $mesg->error_desc );
}

0 comments on commit 0ecb362

Please sign in to comment.