db-3.2.t
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:2k
- #!./perl -w
- # ID: %I%, %G%
- use strict ;
- BEGIN {
- unless(grep /blib/, @INC) {
- chdir 't' if -d 't';
- @INC = '../lib' if -d '../lib';
- }
- }
- #use Config;
- #
- #BEGIN {
- # if(-d "lib" && -f "TEST") {
- # if ($Config{'extensions'} !~ /bBerkeleyDBb/ ) {
- # print "1..74n";
- # exit 0;
- # }
- # }
- #}
- use BerkeleyDB;
- use File::Path qw(rmtree);
- BEGIN
- {
- if ($BerkeleyDB::db_version < 3.2) {
- print "1..0 # Skipping test, this needs Berkeley DB 3.2.x or bettern" ;
- exit 0 ;
- }
- }
- print "1..1n";
- my %DB_errors = (
- 'DB_INCOMPLETE' => "DB_INCOMPLETE: Sync was unable to complete",
- 'DB_KEYEMPTY' => "DB_KEYEMPTY: Non-existent key/data pair",
- 'DB_KEYEXIST' => "DB_KEYEXIST: Key/data pair already exists",
- 'DB_LOCK_DEADLOCK' => "DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock",
- 'DB_LOCK_NOTGRANTED' => "DB_LOCK_NOTGRANTED: Lock not granted",
- 'DB_NOTFOUND' => "DB_NOTFOUND: No matching key/data pair found",
- 'DB_OLD_VERSION' => "DB_OLDVERSION: Database requires a version upgrade",
- 'DB_RUNRECOVERY' => "DB_RUNRECOVERY: Fatal error, run database recovery",
- ) ;
- {
- package LexFile ;
- sub new
- {
- my $self = shift ;
- unlink @_ ;
- bless [ @_ ], $self ;
- }
- sub DESTROY
- {
- my $self = shift ;
- unlink @{ $self } ;
- }
- }
- sub ok
- {
- my $no = shift ;
- my $result = shift ;
-
- print "not " unless $result ;
- print "ok $non" ;
- }
- my $Dfile = "dbhash.tmp";
- my $Dfile2 = "dbhash2.tmp";
- my $Dfile3 = "dbhash3.tmp";
- unlink $Dfile;
- umask(0) ;
- {
- # set_q_extentsize
- ok 1, 1 ;
- }