mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Test script changes to support testing sqlite3_interrupt().
FossilOrigin-Name: 0cede9f898bcd13dab51b25cb0e72213d988d3d2
This commit is contained in:
@ -93,6 +93,16 @@ set FAULTSIM(cantopen-persistent) [list \
|
||||
-injectuninstall cantopen_injectuninstall \
|
||||
]
|
||||
|
||||
set ::default_faults_arg [array names FAULTSIM]
|
||||
|
||||
set FAULTSIM(interrupt) [list \
|
||||
-injectinstall interrupt_injectinstall \
|
||||
-injectstart interrupt_injectstart \
|
||||
-injectstop interrupt_injectstop \
|
||||
-injecterrlist {{1 interrupted} {1 interrupt}} \
|
||||
-injectuninstall interrupt_injectuninstall \
|
||||
]
|
||||
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
@ -113,7 +123,7 @@ set FAULTSIM(cantopen-persistent) [list \
|
||||
proc do_faultsim_test {name args} {
|
||||
global FAULTSIM
|
||||
|
||||
set DEFAULT(-faults) [array names FAULTSIM]
|
||||
set DEFAULT(-faults) $::default_faults_arg
|
||||
set DEFAULT(-prep) ""
|
||||
set DEFAULT(-body) ""
|
||||
set DEFAULT(-test) ""
|
||||
@ -255,6 +265,22 @@ proc cantopen_injectstop {} {
|
||||
shmfault cantopen
|
||||
}
|
||||
|
||||
# The following procs are used as [do_one_faultsim_test] callbacks
|
||||
# when injecting SQLITE_INTERRUPT error faults into test cases.
|
||||
#
|
||||
proc interrupt_injectinstall {} {
|
||||
}
|
||||
proc interrupt_injectuninstall {} {
|
||||
}
|
||||
proc interrupt_injectstart {iFail} {
|
||||
set ::sqlite_interrupt_count $iFail
|
||||
}
|
||||
proc interrupt_injectstop {} {
|
||||
set res [expr $::sqlite_interrupt_count<=0]
|
||||
set ::sqlite_interrupt_count 0
|
||||
set res
|
||||
}
|
||||
|
||||
# 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.
|
||||
|
Reference in New Issue
Block a user