6
unless(grep /blib/, @INC) {
8
@INC = '../lib' if -d '../lib';
13
use File::Path qw(rmtree);
40
print "not " unless $result ;
48
open(CAT,$file) || die "Cannot open $file:$!";
55
my $Dfile = "dbhash.tmp";
61
# let object destroction kill everything
63
my $lex = new LexFile $Dfile ;
67
rmtree $home if -e $home ;
68
ok 1, mkdir($home, 0777) ;
69
ok 2, my $env = new BerkeleyDB::Env -Home => $home,
70
-Flags => DB_CREATE|DB_INIT_TXN|
71
DB_INIT_MPOOL|DB_INIT_LOCK ;
72
ok 3, my $txn = $env->txn_begin() ;
73
ok 4, my $db1 = tie %hash, 'BerkeleyDB::Hash', -Filename => $Dfile,
87
while (my ($k, $v) = each %data) {
88
$ret += $db1->db_put($k, $v) ;
92
# should be able to see all the records
94
ok 6, my $cursor = $db1->db_cursor() ;
95
my ($k, $v) = ("", "") ;
98
while ($cursor->c_get($k, $v, DB_NEXT) == 0) {
104
# now abort the transaction
105
ok 8, $txn->txn_abort() == 0 ;
107
# there shouldn't be any records in the database
110
ok 9, $cursor = $db1->db_cursor() ;
111
while ($cursor->c_get($k, $v, DB_NEXT) == 0) {
124
my $lex = new LexFile $Dfile ;
127
my ($k, $v) = ("", "") ;
128
ok 11, my $db1 = tie %hash, 'BerkeleyDB::Hash',
130
-Flags => DB_CREATE ;
133
ok 12, $cursor = $db1->db_cursor() ;
134
while ($cursor->c_get($k, $v, DB_NEXT) == 0) {