1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Add tests to pager1.test and pagerfault.test.

FossilOrigin-Name: f5df83fd875073eee8e2269e87e2a8c9c7abc981
This commit is contained in:
dan
2010-06-19 17:26:37 +00:00
parent de4996e2ee
commit 146ed78b78
7 changed files with 317 additions and 24 deletions

View File

@ -49,6 +49,16 @@ set FAULTSIM(ioerr-persistent) [list \
-injecterrlist {{1 {disk I/O error}}} \
]
# SQLITE_FULL errors (always persistent):
#
set FAULTSIM(full) [list \
-injectinstall fullerr_injectinstall \
-injectstart fullerr_injectstart \
-injectstop fullerr_injectstop \
-injecterrlist {{1 {database or disk is full}}} \
-injectuninstall fullerr_injectuninstall \
]
# Transient and persistent SHM errors:
#
set FAULTSIM(shmerr-transient) [list \
@ -177,6 +187,7 @@ proc ioerr_injectstop {} {
return $sv
}
# The following procs are used as [do_one_faultsim_test] callbacks when
# injecting shared-memory related error faults into test cases.
#
@ -195,6 +206,22 @@ proc shmerr_injectstop {} {
shmfault ioerr 0 0
}
proc fullerr_injectinstall {} {
testvfs shmfault -default true
}
proc fullerr_injectuninstall {} {
catch {db close}
catch {db2 close}
shmfault delete
}
proc fullerr_injectstart {iFail} {
shmfault full $iFail
}
proc fullerr_injectstop {} {
shmfault full 0
}
# This command is not called directly. It is used by the
# [faultsim_test_result] command created by [do_faultsim_test] and used
# by -test scripts.