3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
11 # This file contains additional out-of-memory checks (see malloc.tcl).
13 # $Id: mallocA.test,v 1.8 2008/02/18 22:24:58 drh Exp $
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 source $testdir/malloc_common.tcl
19 # Only run these tests if memory debugging is turned on.
22 puts "Skipping mallocA tests: not compiled with -DSQLITE_MEMDEBUG..."
28 # Construct a test database
30 file delete -force test.db.bu
32 CREATE TABLE t1(a COLLATE NOCASE,b,c);
33 INSERT INTO t1 VALUES(1,2,3);
34 INSERT INTO t1 VALUES(1,2,4);
35 INSERT INTO t1 VALUES(2,3,4);
36 CREATE INDEX t1i1 ON t1(a);
37 CREATE INDEX t1i2 ON t1(b,c);
38 CREATE TABLE t2(x,y,z);
41 file copy test.db test.db.bu
44 do_malloc_test mallocA-1 -testdb test.db.bu -sqlbody {
47 do_malloc_test mallocA-1.1 -testdb test.db.bu -sqlbody {
50 do_malloc_test mallocA-1.2 -testdb test.db.bu -sqlbody {
53 do_malloc_test mallocA-1.3 -testdb test.db.bu -sqlbody {
57 do_malloc_test mallocA-2 -testdb test.db.bu -sqlbody {
60 do_malloc_test mallocA-3 -testdb test.db.bu -sqlbody {
63 do_malloc_test mallocA-4 -testdb test.db.bu -sqlbody {
66 do_malloc_test mallocA-5 -testdb test.db.bu -sqlbody {
71 # Ensure that no file descriptors were leaked.
74 set sqlite_open_file_count
77 file delete -force test.db.bu