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

Add a test case for the OOM handled by the previous commit.

FossilOrigin-Name: 9bdf7ca1b317fe0ba7efea38fb395bf6130ac89a
This commit is contained in:
dan
2016-09-02 21:34:17 +00:00
parent 76729ed4be
commit c6952addf7
3 changed files with 39 additions and 8 deletions

View File

@ -84,4 +84,35 @@ do_malloc_test backup_malloc-2 -tclprep {
db2 close
}
reset_db
do_execsql_test 3.0 {
PRAGMA page_size = 16384;
BEGIN;
CREATE TABLE t1(a, b);
INSERT INTO t1 VALUES(1, 2);
COMMIT;
}
do_faultsim_test 3 -faults oom* -prep {
catch { db close }
forcedelete test2.db
sqlite3 db2 test2.db
sqlite3 db test.db
sqlite3_backup B db2 main db main
} -body {
set rc [B step 50]
if {$rc == "SQLITE_NOMEM" || $rc == "SQLITE_IOERR_NOMEM"} {
error "out of memory"
}
} -test {
faultsim_test_result {0 {}}
faultsim_integrity_check
# Finalize the backup.
catch { B finish }
}
finish_test