~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/test/recd15scr.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# See the file LICENSE for redistribution information.
2
 
#
3
 
# Copyright (c) 1996-2002
4
 
#       Sleepycat Software.  All rights reserved.
5
 
#
6
 
# $Id$
7
 
#
8
 
# Recd15 - lots of txns - txn prepare script
9
 
# Usage: recd15script envcmd dbcmd gidf numtxns
10
 
# envcmd: command to open env
11
 
# dbfile: name of database file
12
 
# gidf: name of global id file
13
 
# numtxns: number of txns to start
14
 
 
15
 
source ./include.tcl
16
 
source $test_path/test.tcl
17
 
source $test_path/testutils.tcl
18
 
 
19
 
set usage "recd15script envcmd dbfile gidfile numtxns"
20
 
 
21
 
# Verify usage
22
 
if { $argc != 4 } {
23
 
        puts stderr "FAIL:[timestamp] Usage: $usage"
24
 
        exit
25
 
}
26
 
 
27
 
# Initialize arguments
28
 
set envcmd [ lindex $argv 0 ]
29
 
set dbfile [ lindex $argv 1 ]
30
 
set gidfile [ lindex $argv 2 ]
31
 
set numtxns [ lindex $argv 3 ]
32
 
 
33
 
set txnmax [expr $numtxns + 5]
34
 
set dbenv [eval $envcmd]
35
 
error_check_good envopen [is_valid_env $dbenv] TRUE
36
 
 
37
 
set usedb 0
38
 
if { $dbfile != "NULL" } {
39
 
        set usedb 1
40
 
        set db [berkdb_open -auto_commit -env $dbenv $dbfile]
41
 
        error_check_good dbopen [is_valid_db $db] TRUE
42
 
}
43
 
 
44
 
puts "\tRecd015script.a: Begin $numtxns txns"
45
 
for {set i 0} {$i < $numtxns} {incr i} {
46
 
        set t [$dbenv txn]
47
 
        error_check_good txnbegin($i) [is_valid_txn $t $dbenv] TRUE
48
 
        set txns($i) $t
49
 
        if { $usedb } {
50
 
                set dbc [$db cursor -txn $t]
51
 
                error_check_good cursor($i) [is_valid_cursor $dbc $db] TRUE
52
 
                set curs($i) $dbc
53
 
        }
54
 
}
55
 
 
56
 
puts "\tRecd015script.b: Prepare $numtxns txns"
57
 
set gfd [open $gidfile w+]
58
 
for {set i 0} {$i < $numtxns} {incr i} {
59
 
        if { $usedb } {
60
 
                set dbc $curs($i)
61
 
                error_check_good dbc_close [$dbc close] 0
62
 
        }
63
 
        set t $txns($i)
64
 
        set gid [make_gid recd015script:$t]
65
 
        puts $gfd $gid
66
 
        error_check_good txn_prepare:$t [$t prepare $gid] 0
67
 
}
68
 
close $gfd
69
 
 
70
 
#
71
 
# We do not close the db or env, but exit with the txns outstanding.
72
 
#
73
 
puts "\tRecd015script completed successfully"
74
 
flush stdout