3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
13 if {![info exists testdir]} {
14 set testdir [file join [file dirname [info script]] .. .. test]
16 source $testdir/tester.tcl
17 source $testdir/malloc_common.tcl
18 set ::testprefix rbufault4
20 for {set tn 1} {1} {incr tn} {
23 CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
24 CREATE INDEX i1b ON t1(b);
25 CREATE INDEX i1c ON t1(c);
26 INSERT INTO t1 VALUES(1, 2, 3);
27 INSERT INTO t1 VALUES(4, 5, 6);
31 sqlite3rbu_vacuum rbu test.db test.db2
32 for {set i 0} {$i < $tn} {incr i} { rbu step }
34 if {$rc!="SQLITE_OK"} {
35 if {$rc!="SQLITE_DONE"} {error $rc}
40 do_faultsim_test $tn -faults oom-t* -prep {
43 sqlite3rbu_vacuum rbu test.db test.db2
46 if {$rc=="SQLITE_DONE"} break
47 if {$rc!="SQLITE_OK"} { error $rc }
51 faultsim_test_result {0 {}} {1 SQLITE_NOMEM} {1 SQLITE_IOERR_NOMEM}
53 sqlite3rbu_vacuum rbu test.db test.db2
54 while {[rbu step]=="SQLITE_OK"} {}
56 if {$trc!="SQLITE_DONE"} { error "Got $trc instead of SQLITE_DONE!" }
58 set rc [db one {PRAGMA integrity_check}]
59 if {$rc!="ok"} { error "Got $rc instead of ok!" }