~ubuntu-branches/ubuntu/edgy/rpm/edgy

« back to all changes in this revision

Viewing changes to db/test/env009.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2002-01-22 20:56:57 UTC
  • Revision ID: james.westby@ubuntu.com-20020122205657-l74j50mr9z8ofcl5
Tags: upstream-4.0.3
ImportĀ upstreamĀ versionĀ 4.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# See the file LICENSE for redistribution information.
 
2
#
 
3
# Copyright (c) 1999-2001
 
4
#       Sleepycat Software.  All rights reserved.
 
5
#
 
6
# $Id: env009.tcl,v 1.1.2.1 2001/07/23 20:40:23 jbj Exp $
 
7
#
 
8
# Env Test 9
 
9
# Test calls to all the various stat functions.
 
10
# We have several sprinkled throughout the test suite, but
 
11
# this will ensure that we run all of them at least once.
 
12
proc env009 { } {
 
13
        source ./include.tcl
 
14
 
 
15
        puts "Env009: Various stat function test."
 
16
 
 
17
        env_cleanup $testdir
 
18
        puts "\tEnv009.a: Setting up env and a database."
 
19
 
 
20
        set e [berkdb env -create -home $testdir -txn]
 
21
        error_check_good dbenv [is_valid_env $e] TRUE
 
22
        set dbbt [berkdb_open -create -btree $testdir/env009bt.db]
 
23
        error_check_good dbopen [is_valid_db $dbbt] TRUE
 
24
        set dbh [berkdb_open -create -hash $testdir/env009h.db]
 
25
        error_check_good dbopen [is_valid_db $dbh] TRUE
 
26
        set dbq [berkdb_open -create -btree $testdir/env009q.db]
 
27
        error_check_good dbopen [is_valid_db $dbq] TRUE
 
28
 
 
29
        set rlist {
 
30
        { "lock_stat" "Max locks" "Env009.b"}
 
31
        { "log_stat" "Magic" "Env009.c"}
 
32
        { "mpool_stat" "Number of caches" "Env009.d"}
 
33
        { "txn_stat" "Max Txns" "Env009.e"}
 
34
        }
 
35
 
 
36
        foreach pair $rlist {
 
37
                set cmd [lindex $pair 0]
 
38
                set str [lindex $pair 1]
 
39
                set msg [lindex $pair 2]
 
40
                puts "\t$msg: $cmd"
 
41
                set ret [$e $cmd]
 
42
                error_check_good $cmd [is_substr $ret $str] 1
 
43
        }
 
44
        puts "\tEnv009.f: btree stats"
 
45
        set ret [$dbbt stat]
 
46
        error_check_good $cmd [is_substr $ret "Magic"] 1
 
47
        puts "\tEnv009.g: hash stats"
 
48
        set ret [$dbh stat]
 
49
        error_check_good $cmd [is_substr $ret "Magic"] 1
 
50
        puts "\tEnv009.f: queue stats"
 
51
        set ret [$dbq stat]
 
52
        error_check_good $cmd [is_substr $ret "Magic"] 1
 
53
        error_check_good dbclose [$dbbt close] 0
 
54
        error_check_good dbclose [$dbh close] 0
 
55
        error_check_good dbclose [$dbq close] 0
 
56
        error_check_good envclose [$e close] 0
 
57
}