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

Add test cases to ensure that there is at least one test that causes an exception to be thrown from each SEH_INJECT_FAULT macro.

FossilOrigin-Name: e480146f49004c818ad93464289761d8a7246b502bd079f8140d0a6f684ebe4e
This commit is contained in:
dan
2021-08-21 15:49:15 +00:00
parent 67ae593ffe
commit 101a6b87c7
3 changed files with 39 additions and 9 deletions

View File

@ -13,7 +13,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/malloc_common.tcl
set testprefix seh1
set testprefix walseh1
set ::seh_countdown 0
proc seh_faultsim_callback {iFault} {
@ -101,6 +101,36 @@ do_faultsim_test 4 -faults seh -prep {
}
catch { db close }
do_faultsim_test 5 -faults seh -prep {
catch { db close }
faultsim_restore_and_reopen
execsql {
PRAGMA cache_size = 5;
BEGIN;
WITH s(i) AS (
SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<50
)
INSERT INTO t1 SELECT randomblob(500), randomblob(500) FROM s;
}
} -body {
execsql ROLLBACK
} -test {
faultsim_test_result {0 {}}
}
catch { db close }
do_faultsim_test 6 -faults seh -prep {
catch { db close }
faultsim_restore_and_reopen
} -body {
execsql { PRAGMA wal_checkpoint = TRUNCATE }
execsql { INSERT INTO t1 VALUES(7, 8) }
execsql { SELECT * FROM t1 }
} -test {
faultsim_test_result {0 {1 2 3 4 7 8}}
}
catch { db close }
finish_test