=================================================================== RCS file: /cvs/palm/Palm-Keyring/t/keyring5-samples.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- palm/Palm-Keyring/t/keyring5-samples.t 2007/02/18 05:50:25 1.1 +++ palm/Palm-Keyring/t/keyring5-samples.t 2007/02/22 04:57:37 1.2 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: keyring4.t,v 1.1 2007/02/17 23:36:07 andrew Exp $ +# $RedRiver: keyring5-samples.t,v 1.1 2007/02/18 05:50:25 andrew Exp $ use strict; use warnings; @@ -83,12 +83,26 @@ my $pdb; ok( $pdb = new Palm::PDB, 'new Palm::PDB' ); ok( $pdb->Load('t/' . $file), "Loading '$file'" ); - ok( $pdb->Password($password), 'Passing Password' ); - my @recs = (); - foreach my $rec (@{ $pdb->{records}}) { - my $acct; - ok( $acct = $pdb->Decrypt( $rec ), 'Decrypting record ' . scalar @recs ); - push @recs, $acct; + SKIP: { + skip 'Digest::HMAC_SHA1 not installed', 5 unless + eval " require Digest::HMAC_SHA1 "; + + if ($pdb->{appinfo}->{cipher} > 0) { + my $crypt = Palm::Keyring::crypts($pdb->{appinfo}->{cipher}); + skip 'Crypt::CBC not installed', 5 unless + eval "require Crypt::CBC"; + skip 'Crypt::' . $crypt->{name} . ' not installed', 5 unless + eval "require Crypt::$crypt->{name}"; + } + + $password = 'abc'; + ok( $pdb->Password($password), 'Passing Password' ); + my @recs = (); + foreach my $rec (@{ $pdb->{records}}) { + my $acct; + ok( $acct = $pdb->Decrypt( $rec ), 'Decrypting record ' . scalar @recs ); + push @recs, $acct; + } + is_deeply(\@recs, $orig_recs, "Matching records in '$file'" ); } - is_deeply( $orig_recs, \@recs, "Matching records in '$file'" ); }