1# 2007 May 30 2# 3# The author disclaims copyright to this source code. In place of 4# a legal notice, here is a blessing: 5# 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. 9# 10#*********************************************************************** 11# This file contains additional out-of-memory checks (see malloc.tcl). 12# These were all discovered by fuzzy generation of SQL. Apart from 13# that they have little in common. 14# 15# $Id: mallocB.test,v 1.2 2007/05/31 08:20:44 danielk1977 Exp $ 16 17set testdir [file dirname $argv0] 18source $testdir/tester.tcl 19source $testdir/malloc_common.tcl 20 21# Only run these tests if memory debugging is turned on. 22# 23if {[info command sqlite_malloc_stat]==""} { 24 puts "Skipping malloc tests: not compiled with -DSQLITE_MEMDEBUG..." 25 finish_test 26 return 27} 28 29do_malloc_test mallocB-1 -sqlbody {SELECT - 456} 30do_malloc_test mallocB-2 -sqlbody {SELECT - 456.1} 31do_malloc_test mallocB-3 -sqlbody {SELECT random()} 32do_malloc_test mallocB-4 -sqlbody {SELECT zeroblob(1000)} 33do_malloc_test mallocB-5 -sqlbody {SELECT * FROM (SELECT 1) GROUP BY 1;} 34 35sqlite_malloc_fail 0 36finish_test 37