diff options
author | drh <drh@noemail.net> | 2007-03-15 12:17:42 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2007-03-15 12:17:42 +0000 |
commit | d5eb79eb40e9ab3fd6a44f3c4a2bf901aa91d13c (patch) | |
tree | 037c8a0ca8cecd8b0130eaf0d084289622b2b700 /test | |
parent | b69d96d22c51bb16d9fbdd68c271e54956c5cb6c (diff) | |
download | sqlite-d5eb79eb40e9ab3fd6a44f3c4a2bf901aa91d13c.tar.gz sqlite-d5eb79eb40e9ab3fd6a44f3c4a2bf901aa91d13c.zip |
Infrastructure to make simulated I/O errors persistent instead of
transient. (CVS 3689)
FossilOrigin-Name: 1a53f531ecd51938fab37a59b7088d89d8f8569d
Diffstat (limited to 'test')
-rw-r--r-- | test/ioerr.test | 14 | ||||
-rw-r--r-- | test/tester.tcl | 5 |
2 files changed, 14 insertions, 5 deletions
diff --git a/test/ioerr.test b/test/ioerr.test index e9df0321d..c9513ab65 100644 --- a/test/ioerr.test +++ b/test/ioerr.test @@ -15,7 +15,7 @@ # The tests in this file use special facilities that are only # available in the SQLite test fixture. # -# $Id: ioerr.test,v 1.29 2007/01/04 14:58:14 drh Exp $ +# $Id: ioerr.test,v 1.30 2007/03/15 12:17:43 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -46,9 +46,6 @@ do_ioerr_test ioerr-1 -erc 1 -sqlprep { DELETE FROM t1 WHERE a<100; } -exclude [expr [string match [execsql {pragma auto_vacuum}] 1] ? 4 : 0] -finish_test -return - # Test for IO errors during a VACUUM. # # The first IO call is excluded from the test. This call attempts to read @@ -260,4 +257,13 @@ do_ioerr_test ioerr-10 -tclprep { } } +# Assertion fault bug reported by alex dimitrov. +# +do_ioerr_test ioerr-11 -erc 1 -sqlprep { + CREATE TABLE A(Id INTEGER, Name TEXT); + INSERT INTO A(Id, Name) VALUES(1, 'Name'); +} -sqlbody { + UPDATE A SET Id = 2, Name = 'Name2' WHERE Id = 1; +} + finish_test diff --git a/test/tester.tcl b/test/tester.tcl index b8d4a1ad7..9d2f684d7 100644 --- a/test/tester.tcl +++ b/test/tester.tcl @@ -11,7 +11,7 @@ # This file implements some common TCL routines used for regression # testing the SQLite library # -# $Id: tester.tcl,v 1.72 2007/01/04 14:58:14 drh Exp $ +# $Id: tester.tcl,v 1.73 2007/03/15 12:17:43 drh Exp $ # Make sure tclsqlite3 was compiled correctly. Abort now with an # error message if not. @@ -342,6 +342,7 @@ proc crashsql {crashdelay crashfile sql} { # -sqlbody TCL script to run with IO error simulation. # -exclude List of 'N' values not to test. # -erc Use extended result codes +# -persist Make simulated I/O errors persistent # -start Value of 'N' to begin with (default 1) # # -cksum Boolean. If true, test that the database does @@ -353,6 +354,7 @@ proc do_ioerr_test {testname args} { set ::ioerropts(-cksum) 0 set ::ioerropts(-erc) 0 set ::ioerropts(-count) 100000000 + set ::ioerropts(-persist) 1 array set ::ioerropts $args set ::go 1 @@ -392,6 +394,7 @@ proc do_ioerr_test {testname args} { # Set the Nth IO error to fail. do_test $testname.$n.2 [subst { + set ::sqlite_io_error_persist $::ioerropts(-persist) set ::sqlite_io_error_pending $n }] $n |