1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/mallocI.test Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,43 @@
1.4 +# 2008 August 01
1.5 +#
1.6 +# The author disclaims copyright to this source code. In place of
1.7 +# a legal notice, here is a blessing:
1.8 +#
1.9 +# May you do good and not evil.
1.10 +# May you find forgiveness for yourself and forgive others.
1.11 +# May you share freely, never taking more than you give.
1.12 +#
1.13 +#***********************************************************************
1.14 +#
1.15 +# This test script checks malloc failures in various obscure operations.
1.16 +#
1.17 +# $Id: mallocI.test,v 1.1 2008/08/02 03:50:39 drh Exp $
1.18 +
1.19 +set testdir [file dirname $argv0]
1.20 +source $testdir/tester.tcl
1.21 +source $testdir/malloc_common.tcl
1.22 +
1.23 +# Malloc failures in a view.
1.24 +#
1.25 +do_malloc_test mallocI-1 -sqlprep {
1.26 + CREATE TABLE t1(a,b,c,d);
1.27 + CREATE VIEW v1 AS SELECT a*b, c*d FROM t1 ORDER BY b-d;
1.28 +} -sqlbody {
1.29 + SELECT * FROM v1
1.30 +}
1.31 +
1.32 +# Malloc failure while trying to service a pragma on a TEMP database.
1.33 +#
1.34 +do_malloc_test mallocI-2 -sqlbody {
1.35 + PRAGMA temp.page_size
1.36 +}
1.37 +
1.38 +# Malloc failure while creating a table from a SELECT statement.
1.39 +#
1.40 +do_malloc_test mallocI-3 -sqlprep {
1.41 + CREATE TABLE t1(a,b,c);
1.42 +} -sqlbody {
1.43 + CREATE TABLE t2 AS SELECT b,c FROM t1;
1.44 +}
1.45 +
1.46 +finish_test