1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Add tests to cover a couple of branches in wal.c.

FossilOrigin-Name: 429f437fb776fc974a6adf791b729e25bea82fef
This commit is contained in:
dan
2010-05-06 14:42:34 +00:00
parent c9e4665e7d
commit a861469a07
4 changed files with 46 additions and 27 deletions

View File

@ -210,5 +210,30 @@ do_shmfault_test walfault-shm-3 -methods xShmSize -tclprep {
SELECT count(*) FROM t1;
}
do_shmfault_test walfault-shm-4 -tclprep {
sqlite3 db test.db -vfs shmfault
unset -nocomplain ::shmfault_ioerr_countdown
db eval {
PRAGMA page_size = 512;
PRAGMA journal_mode = WAL;
PRAGMA wal_autocheckpoint = 0;
CREATE TABLE t1(x);
BEGIN;
INSERT INTO t1 VALUES(randomblob(400)); /* 1 */
INSERT INTO t1 SELECT randomblob(400) FROM t1; /* 2 */
INSERT INTO t1 SELECT randomblob(400) FROM t1; /* 4 */
COMMIT;
}
set ::shmfault_ioerr_countdown 1
set ::shmfault_ioerr_methods(xShmGet) 1
db close
unset ::shmfault_ioerr_methods(xShmGet)
if {[file exists test.db-wal]==0} {error "Failed to create WAL file!"}
sqlite3 db test.db -vfs shmfault
} -sqlbody {
SELECT count(*) FROM t1;
}
finish_test