da57895fec
FossilOrigin-Name: 741d6fb096dcb232871d3a8468c386022afcf554
48 lines
1.2 KiB
Plaintext
48 lines
1.2 KiB
Plaintext
# 2005 September 19
|
|
#
|
|
# The author disclaims copyright to this source code. In place of
|
|
# a legal notice, here is a blessing:
|
|
#
|
|
# May you do good and not evil.
|
|
# May you find forgiveness for yourself and forgive others.
|
|
# May you share freely, never taking more than you give.
|
|
#
|
|
#*************************************************************************
|
|
# This file implements regression tests for SQLite library. The
|
|
# focus of this script is testing the ATTACH statement and
|
|
# specifically out-of-memory conditions within that command.
|
|
#
|
|
# $Id: attachmalloc.test,v 1.5 2007/08/27 23:48:24 drh Exp $
|
|
#
|
|
|
|
set testdir [file dirname $argv0]
|
|
source $testdir/tester.tcl
|
|
|
|
ifcapable !memdebug {
|
|
finish_test
|
|
return
|
|
}
|
|
|
|
source $testdir/malloc_common.tcl
|
|
|
|
do_malloc_test attachmalloc-1 -tclprep {
|
|
db close
|
|
for {set i 2} {$i<=4} {incr i} {
|
|
file delete -force test$i.db
|
|
file delete -force test$i.db-journal
|
|
}
|
|
} -tclbody {
|
|
if {[catch {sqlite3 db test.db}]} {
|
|
error "out of memory"
|
|
}
|
|
} -sqlbody {
|
|
ATTACH 'test2.db' AS two;
|
|
CREATE TABLE two.t1(x);
|
|
ATTACH 'test3.db' AS three;
|
|
CREATE TABLE three.t1(x);
|
|
ATTACH 'test4.db' AS four;
|
|
CREATE TABLE four.t1(x);
|
|
}
|
|
|
|
finish_test
|