sl@0: # 2007 Aug 29 sl@0: # sl@0: # The author disclaims copyright to this source code. In place of sl@0: # a legal notice, here is a blessing: sl@0: # sl@0: # May you do good and not evil. sl@0: # May you find forgiveness for yourself and forgive others. sl@0: # May you share freely, never taking more than you give. sl@0: # sl@0: #*********************************************************************** sl@0: # sl@0: # $Id: mallocD.test,v 1.6 2008/02/18 22:24:58 drh Exp $ sl@0: sl@0: set testdir [file dirname $argv0] sl@0: source $testdir/tester.tcl sl@0: source $testdir/malloc_common.tcl sl@0: sl@0: # Only run these tests if memory debugging is turned on. sl@0: # sl@0: if {!$MEMDEBUG} { sl@0: puts "Skipping mallocD tests: not compiled with -DSQLITE_MEMDEBUG..." sl@0: finish_test sl@0: return sl@0: } sl@0: sl@0: db close sl@0: sqlite3_simulate_device -char atomic sl@0: sqlite3 db test.db -vfs devsym sl@0: sl@0: set PREP { sl@0: PRAGMA page_size = 1024; sl@0: CREATE TABLE abc(a, b, c); sl@0: } sl@0: sl@0: do_malloc_test mallocD-1 -sqlprep $PREP -sqlbody { sl@0: INSERT INTO abc VALUES(1, 2, 3); sl@0: } sl@0: sl@0: do_malloc_test mallocD-2 -sqlprep $PREP -sqlbody { sl@0: BEGIN; sl@0: INSERT INTO abc VALUES(1, 2, 3); sl@0: INSERT INTO abc VALUES(4, 5, 6); sl@0: ROLLBACK; sl@0: } sl@0: sl@0: do_malloc_test mallocD-3 -sqlprep $PREP -sqlbody { sl@0: BEGIN; sl@0: INSERT INTO abc VALUES(1, 2, 3); sl@0: INSERT INTO abc VALUES(4, 5, randstr(1500,1500)); sl@0: COMMIT; sl@0: } sl@0: sl@0: ifcapable attach { sl@0: do_malloc_test mallocD-4 -sqlprep $PREP -sqlbody { sl@0: ATTACH 'test2.db' AS aux; sl@0: BEGIN; sl@0: CREATE TABLE aux.def(d, e, f); sl@0: INSERT INTO abc VALUES(4, 5, 6); sl@0: COMMIT; sl@0: } sl@0: } sl@0: sl@0: sqlite3_simulate_device -char {} sl@0: sl@0: finish_test