version 1.3, 2007/01/30 04:59:55 |
version 1.4, 2007/02/01 01:56:11 |
|
|
# (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; |
|
|
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; |
|
|
} |
} |
$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"; |
|
|
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; |