ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/BDB/t/01_basic.t
Revision: 1.3
Committed: Wed Jul 15 14:40:00 2009 UTC (17 years, 2 months ago) by root
Content type: application/x-troff
Branch: MAIN
CVS Tags: rel-1_9, rel-1_88, rel-1_89, rel-1_86, rel-1_87, rel-1_84, rel-1_92, rel-1_85, HEAD
Changes since 1.2: +2 -0 lines
Error occurred while calculating annotation data.
Log Message:
*** empty log message ***

File Contents

# Content
1 #! perl
2
3 $| = 1;
4
5 print "1..10\n";
6
7 use BDB;
8
9 BDB::max_parallel 1;
10
11 my $env = db_env_create;
12
13 print $env->set_flags (BDB::AUTO_COMMIT | BDB::TXN_NOSYNC, 1) ? "not " : "", "ok 1\n";
14
15 $env->set_flags (&BDB::LOG_AUTOREMOVE | &BDB::LOG_INMEMORY ) if BDB::VERSION v0, v4.7;
16 $env->log_set_config (&BDB::LOG_AUTO_REMOVE | &BDB::LOG_IN_MEMORY) if BDB::VERSION v4.7;
17
18 db_env_open
19 $env,
20 undef,
21 BDB::PRIVATE
22 | BDB::INIT_LOCK | BDB::INIT_LOG | BDB::INIT_MPOOL
23 | BDB::INIT_TXN | BDB::RECOVER | BDB::USE_ENVIRON | BDB::CREATE,
24 0600;
25
26 print $! ? "not " : "", "ok 2 # $!\n";#d#
27
28 my $db = db_create $env;
29
30 db_open $db, undef, undef, undef, BDB::BTREE, BDB::AUTO_COMMIT | BDB::CREATE, 0600;
31
32 print $! ? "not " : "", "ok 3 # $!\n";#d#
33
34 db_put $db, undef, "key", "data", sub {
35 print "ok 5\n";
36 db_del $db, undef, "key";
37 };
38 db_sync $db, sub {
39 print "ok 6\n";
40 };
41 print "ok 4\n";
42 BDB::flush;
43
44 print "ok 7\n";
45 db_sync $db;
46 print "ok 8\n";
47
48 undef $db;
49 print "ok 9\n";
50 undef $env;
51 print "ok 10\n";
52
53