1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/mallocF.test Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,76 @@
1.4 +# 2007 Aug 29
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 that tickets #2794, #2795, #2796, and #2797
1.16 +# have been fixed.
1.17 +#
1.18 +# $Id: mallocF.test,v 1.4 2008/02/18 22:24:58 drh Exp $
1.19 +
1.20 +set testdir [file dirname $argv0]
1.21 +source $testdir/tester.tcl
1.22 +source $testdir/malloc_common.tcl
1.23 +
1.24 +# Only run these tests if memory debugging is turned on.
1.25 +#
1.26 +if {!$MEMDEBUG} {
1.27 + puts "Skipping mallocF tests: not compiled with -DSQLITE_MEMDEBUG..."
1.28 + finish_test
1.29 + return
1.30 +}
1.31 +
1.32 +# tickets #2794 and #2795 and #2797
1.33 +#
1.34 +set PREP {
1.35 + CREATE TABLE t1(x,y);
1.36 + INSERT INTO t1 VALUES('abc123', 5);
1.37 + INSERT INTO t1 VALUES('xyz987', 42);
1.38 +}
1.39 +do_malloc_test malloeF-1 -sqlprep $PREP -sqlbody {
1.40 + SELECT * FROM t1 WHERE x GLOB 'abc*'
1.41 +}
1.42 +
1.43 +# ticket #2796
1.44 +#
1.45 +set PREP {
1.46 + CREATE TABLE t1(x PRIMARY KEY,y UNIQUE);
1.47 + INSERT INTO t1 VALUES('abc123', 5);
1.48 + INSERT INTO t1 VALUES('xyz987', 42);
1.49 +}
1.50 +do_malloc_test malloeF-2 -sqlprep $PREP -sqlbody {
1.51 + SELECT x FROM t1
1.52 + WHERE y=1 OR y=2 OR y=3 OR y=4 OR y=5
1.53 + OR y=6 OR y=7 OR y=8 OR y=9 OR y=10
1.54 + OR y=11 OR y=12 OR y=13 OR y=14 OR y=15
1.55 + OR y=x
1.56 +}
1.57 +
1.58 +set PREP {
1.59 + CREATE TABLE t1(x PRIMARY KEY,y UNIQUE);
1.60 + INSERT INTO t1 VALUES('abc123', 5);
1.61 + INSERT INTO t1 VALUES('xyz987', 42);
1.62 +}
1.63 +do_malloc_test malloeF-3 -sqlprep $PREP -sqlbody {
1.64 + SELECT x FROM t1 WHERE y BETWEEN 10 AND 29
1.65 +}
1.66 +
1.67 +# Ticket #2843
1.68 +#
1.69 +set PREP {
1.70 + CREATE TABLE t1(x);
1.71 + CREATE TRIGGER r1 BEFORE INSERT ON t1 BEGIN
1.72 + SELECT 'hello';
1.73 + END;
1.74 +}
1.75 +do_malloc_test mallocF-4 -sqlprep $PREP -sqlbody {
1.76 + INSERT INTO t1 VALUES(random());
1.77 +}
1.78 +
1.79 +finish_test