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

Add new test file e_droptrigger.test.

FossilOrigin-Name: d23ef9b88c6705219e5138e50f0f351f6401c401
This commit is contained in:
dan
2010-11-29 12:06:45 +00:00
parent 6ea28d6d84
commit ccc7ff4d34
6 changed files with 293 additions and 49 deletions

View File

@ -135,6 +135,7 @@ proc do_faultsim_test {name args} {
}
}
#-------------------------------------------------------------------------
# Procedures to save and restore the current file-system state:
#
@ -144,29 +145,16 @@ proc do_faultsim_test {name args} {
# faultsim_restore_and_reopen
# faultsim_delete_and_reopen
#
proc faultsim_save {} {
foreach f [glob -nocomplain sv_test.db*] { forcedelete $f }
foreach f [glob -nocomplain test.db*] {
set f2 "sv_$f"
file copy -force $f $f2
}
proc faultsim_save {args} { uplevel db_save $args }
proc faultsim_save_and_close {args} { uplevel db_save_and_close $args }
proc faultsim_restore {args} { uplevel db_restore $args }
proc faultsim_restore_and_reopen {args} {
uplevel db_restore_and_reopen $args
sqlite3_extended_result_codes db 1
sqlite3_db_config_lookaside db 0 0 0
}
proc faultsim_save_and_close {} {
faultsim_save
catch { db close }
return ""
}
proc faultsim_restore {} {
foreach f [glob -nocomplain test.db*] { forcedelete $f }
foreach f2 [glob -nocomplain sv_test.db*] {
set f [string range $f2 3 end]
file copy -force $f2 $f
}
}
proc faultsim_restore_and_reopen {{dbfile test.db}} {
catch { db close }
faultsim_restore
sqlite3 db $dbfile
proc faultsim_delete_and_reopen {args} {
uplevel db_delete_and_reopen $args
sqlite3_extended_result_codes db 1
sqlite3_db_config_lookaside db 0 0 0
}
@ -176,12 +164,6 @@ proc faultsim_integrity_check {{db db}} {
if {$ic != "ok"} { error "Integrity check: $ic" }
}
proc faultsim_delete_and_reopen {{file test.db}} {
catch { db close }
foreach f [glob -nocomplain test.db*] { file delete -force $f }
sqlite3 db $file
}
# The following procs are used as [do_one_faultsim_test] callbacks when
# injecting OOM faults into test cases.