2 #pragma ident "%Z%%M% %I% %E% SMI"
6 # The author disclaims copyright to this source code. In place of
7 # a legal notice, here is a blessing:
9 # May you do good and not evil.
10 # May you find forgiveness for yourself and forgive others.
11 # May you share freely, never taking more than you give.
13 #***********************************************************************
14 # This file implements regression tests for SQLite library. The
15 # focus of this script is btree database backend
17 # This file focuses on testing the sqliteBtreeNext() and
18 # sqliteBtreePrevious() procedures and making sure they are able
19 # to step through an entire table from either direction.
21 # $Id: btree4.test,v 1.1 2002/12/04 13:40:27 drh Exp $
24 set testdir [file dirname $argv0]
25 source $testdir/tester.tcl
27 if {[info commands btree_open]!=""} {
29 # Open a test database.
31 file delete -force test1.bt
32 file delete -force test1.bt-journal
33 set b1 [btree_open test1.bt]
34 btree_begin_transaction $::b1
36 set data {abcdefghijklmnopqrstuvwxyz0123456789}
42 foreach N {10 100 1000} {
43 btree_clear_table $::b1 2
44 set ::c1 [btree_cursor $::b1 2 1]
46 for {set i 1} {$i<=$N} {incr i} {
47 btree_insert $::c1 [format k-%05d $i] $::data-$i
55 for {set i 2} {$i<=$N} {incr i} {
56 do_test btree-$N.3.$i.1 {
59 do_test btree-$N.3.$i.2 {
62 do_test btree-$N.3.$i.3 {
78 for {set i [expr {$N-1}]} {$i>=1} {incr i -1} {
79 do_test btree4-$N.8.$i.1 {
82 do_test btree4-$N.8.$i.2 {
85 do_test btree4-$N.8.$i.3 {
92 btree_close_cursor $::c1
96 btree_pager_ref_dump $::b1
99 } ;# end if( not mem: and has pager_open command );