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

Bring test coverage up to 99%. (CVS 5522)

FossilOrigin-Name: 2cd6bae80984126023bcf479e5f3db5eaa5c4134
This commit is contained in:
drh
2008-08-01 20:10:08 +00:00
parent 4cfb22f798
commit c890fec362
11 changed files with 85 additions and 59 deletions

View File

@ -11,7 +11,7 @@
#
# This test script checks malloc failures in various obscure operations.
#
# $Id: mallocH.test,v 1.1 2008/08/01 18:47:02 drh Exp $
# $Id: mallocH.test,v 1.2 2008/08/01 20:10:09 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -48,4 +48,26 @@ do_malloc_test mallocH-3 -sqlbody {
SELECT replace('ababa','a','xyzzy');
}
# Malloc failures during EXPLAIN.
#
ifcapable explain {
do_malloc_test mallocH-4 -sqlprep {
CREATE TABLE abc(a PRIMARY KEY, b, c);
} -sqlbody {
EXPLAIN SELECT * FROM abc AS t2 WHERE rowid=1;
EXPLAIN QUERY PLAN SELECT * FROM abc AS t2 WHERE rowid=1;
}
}
# Malloc failure during integrity_check pragma.
#
do_malloc_test mallocH-5 -sqlprep {
CREATE TABLE t1(a PRIMARY KEY, b UNIQUE);
CREATE TABLE t2(x,y);
INSERT INTO t1 VALUES(1,2);
INSERT INTO t2 SELECT * FROM t1;
} -sqlbody {
PRAGMA integrity_check;
}
finish_test