[BACK]Return to keyring.t CVS log [TXT][DIR] Up to [local] / palm / Palm-Keyring / t

Diff for /palm/Palm-Keyring/t/keyring.t between version 1.3 and 1.4

version 1.3, 2007/01/30 04:59:55 version 1.4, 2007/02/01 01:56:11
Line 7 
Line 7 
 # (It may become useful if the test is moved to ./t subdirectory.)  # (It may become useful if the test is moved to ./t subdirectory.)
   
 my $test = 1;  my $test = 1;
 BEGIN { $| = 1; print "1..12\n"; }  BEGIN { $| = 1; print "1..17\n"; }
 END {print "not ok $test\n" unless $loaded;}  END {print "not ok $test\n" unless $loaded;}
 use Palm::PDB;  use Palm::PDB;
 use Palm::Keyring;  use Palm::Keyring;
Line 29 
Line 29 
         account     => 'atestaccount',          account     => 'atestaccount',
         password    => $password,          password    => $password,
         notes       => 'now that really roxorZ!',          notes       => 'now that really roxorZ!',
       lastchange  => {
           day   =>  2,
           month =>  2,
           year  => 99,
       },
 };  };
   
 my $pdb;  my $pdb;
Line 100 
Line 105 
 }  }
 $test++;  $test++;
   
   my $old_date = $acct->{'lastchange'};
   
 eval { $pdb->Password($password, $new_password) || die };  eval { $pdb->Password($password, $new_password) || die };
 unless( $@ ) {  unless( $@ ) {
         print "ok $test\n";          print "ok $test\n";
Line 123 
Line 130 
         print "not ok $test\n";          print "not ok $test\n";
 }  }
 $test++;  $test++;
   
   my $new_date = $acct->{'lastchange'};
   
   if (
       $old_date->{'day'}   == $new_date->{'day'}   &&
       $old_date->{'month'} == $new_date->{'month'} &&
       $old_date->{'year'}  == $new_date->{'year'}
   ) {
       print "ok $test\n";
   } else {
       print "not ok $test\n";
   }
   $test++;
   
   $acct->{'password'} = $new_password;
   
   eval { $acct = $pdb->Encrypt($pdb->{'records'}->[1], $acct) || die };
   unless( $@ ) {
           print "ok $test\n";
   } else {
           print "not ok $test\n";
   }
   $test++;
   
   $old_date = $new_date;
   $new_date = $acct->{'lastchange'};
   
   eval { $acct = $pdb->Decrypt($pdb->{'records'}->[1]) || die };
   unless( $@ ) {
           print "ok $test\n";
   } else {
           print "not ok $test\n";
   }
   $test++;
   
   if (
       $old_date->{'day'}   != $new_date->{'day'}   ||
       $old_date->{'month'} != $new_date->{'month'} ||
       $old_date->{'year'}  != $new_date->{'year'}
   ) {
       print "ok $test\n";
   } else {
       print "not ok $test\n";
   }
   $test++;
   
   if ($acct->{'password'} eq $new_password) {
           print "ok $test\n";
   } else {
           print "not ok $test\n";
   }
   $test++;
   
   
 unlink($file);  unlink($file);
   
 1;  1;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>