1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Additional test cases to cover branches in pager.c.

FossilOrigin-Name: eddfb2b4062f8a8b907f0c7bc08a05c16692e900
This commit is contained in:
dan
2010-07-02 11:27:43 +00:00
parent b2961b00f3
commit c396d4af58
8 changed files with 187 additions and 62 deletions

View File

@ -545,6 +545,9 @@ do_faultsim_test pagerfault-11 -prep {
faultsim_integrity_check
}
}
#-------------------------------------------------------------------------
# Test fault injection when writing to a database file that resides on
# a file-system with a sector-size larger than the database page-size.
@ -571,7 +574,8 @@ do_test pagerfault-12-pre1 {
}
faultsim_save_and_close
} {}
do_faultsim_test pagerfault-12 -prep {
do_faultsim_test pagerfault-12a -prep {
faultsim_restore_and_reopen
execsql { PRAGMA cache_size = 10 }
db func a_string a_string;
@ -584,6 +588,31 @@ do_faultsim_test pagerfault-12 -prep {
faultsim_integrity_check
}
do_test pagerfault-12-pre2 {
faultsim_restore_and_reopen
execsql {
CREATE TABLE t2 AS SELECT * FROM t1 LIMIT 10;
}
faultsim_save_and_close
} {}
do_faultsim_test pagerfault-12b -prep {
faultsim_restore_and_reopen
db func a_string a_string;
execsql { SELECT * FROM t1 }
} -body {
set sql(1) { UPDATE t2 SET x = a_string(280) }
set sql(2) { UPDATE t1 SET x = a_string(280) WHERE rowid = 5 }
db eval { SELECT rowid FROM t1 LIMIT 2 } { db eval $sql($rowid) }
} -test {
faultsim_test_result {0 {}}
faultsim_integrity_check
}
catch { db close }
ss_layer delete
#-------------------------------------------------------------------------
# Test fault injection when SQLite opens a database where the size of the
@ -936,7 +965,5 @@ do_faultsim_test pagerfault-21 -prep {
faultsim_test_result {0 {}}
}
}
finish_test