forked from mackyle/sqlite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41ebe97
commit 935642b
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 2013 April 02 | ||
# | ||
# The author disclaims copyright to this source code. In place of | ||
# a legal notice, here is a blessing: | ||
# | ||
# May you do good and not evil. | ||
# May you find forgiveness for yourself and forgive others. | ||
# May you share freely, never taking more than you give. | ||
# | ||
#*********************************************************************** | ||
# | ||
# This file contains fault injection tests designed to test the btree.c | ||
# module. | ||
# | ||
|
||
set testdir [file dirname $argv0] | ||
source $testdir/tester.tcl | ||
source $testdir/malloc_common.tcl | ||
set testprefix btreefault | ||
|
||
do_test 1-pre1 { | ||
execsql { | ||
PRAGMA auto_vacuum = incremental; | ||
PRAGMA journal_mode = DELETE; | ||
CREATE TABLE t1(a PRIMARY KEY, b); | ||
INSERT INTO t1 VALUES(randomblob(1000), randomblob(100)); | ||
INSERT INTO t1 SELECT randomblob(1000), randomblob(1000) FROM t1; | ||
INSERT INTO t1 SELECT randomblob(1000), randomblob(1000) FROM t1; | ||
INSERT INTO t1 SELECT randomblob(1000), randomblob(1000) FROM t1; | ||
INSERT INTO t1 SELECT randomblob(1000), randomblob(1000) FROM t1; | ||
DELETE FROM t1 WHERE rowid%2; | ||
} | ||
faultsim_save_and_close | ||
} {} | ||
|
||
do_faultsim_test 1 -prep { | ||
faultsim_restore_and_reopen | ||
set ::STMT [sqlite3_prepare db "SELECT * FROM t1 ORDER BY a" -1 DUMMY] | ||
sqlite3_step $::STMT | ||
sqlite3_step $::STMT | ||
} -body { | ||
execsql { PRAGMA incremental_vacuum = 10 } | ||
} -test { | ||
sqlite3_finalize $::STMT | ||
faultsim_test_result {0 {}} | ||
faultsim_integrity_check | ||
} | ||
|
||
finish_test | ||
|