aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/avtrans.test4
-rw-r--r--test/cache.test4
-rw-r--r--test/capi3.test5
-rw-r--r--test/exclusive.test4
-rw-r--r--test/exclusive2.test11
-rw-r--r--test/incrblob.test7
-rw-r--r--test/lock2.test4
-rw-r--r--test/malloc5.test3
-rw-r--r--test/pageropt.test5
-rw-r--r--test/softheap1.test10
10 files changed, 42 insertions, 15 deletions
diff --git a/test/avtrans.test b/test/avtrans.test
index 35dba8534..c28347e79 100644
--- a/test/avtrans.test
+++ b/test/avtrans.test
@@ -12,7 +12,7 @@
# file is a copy of "trans.test" modified to run under autovacuum mode.
# the point is to stress the autovacuum logic and try to get it to fail.
#
-# $Id: avtrans.test,v 1.4 2006/02/11 01:25:51 drh Exp $
+# $Id: avtrans.test,v 1.5 2007/08/12 20:07:59 drh Exp $
set testdir [file dirname $argv0]
@@ -87,6 +87,7 @@ integrity_check avtrans-2.11
# Check the locking behavior
#
+sqlite3_soft_heap_limit 0
do_test avtrans-3.1 {
execsql {
BEGIN;
@@ -161,6 +162,7 @@ do_test avtrans-3.14 {
} db} msg]
lappend v $msg
} {0 {1 2 3 4}}
+sqlite3_soft_heap_limit $soft_limit
integrity_check avtrans-3.15
do_test avtrans-4.1 {
diff --git a/test/cache.test b/test/cache.test
index 20322fec5..6a463aa8c 100644
--- a/test/cache.test
+++ b/test/cache.test
@@ -9,7 +9,7 @@
#
#***********************************************************************
#
-# $Id: cache.test,v 1.2 2007/04/06 21:42:22 drh Exp $
+# $Id: cache.test,v 1.3 2007/08/12 20:07:59 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -18,6 +18,7 @@ ifcapable {!pager_pragmas} {
finish_test
return
}
+sqlite3_soft_heap_limit 0
proc pager_cache_size {db} {
set bt [btree_from_db $db]
@@ -55,5 +56,6 @@ for {set ii 0} {$ii < 10} {incr ii} {
} $::cache_size
}
+sqlite3_soft_heap_limit $soft_limit
finish_test
diff --git a/test/capi3.test b/test/capi3.test
index ac36b890c..650cf09a0 100644
--- a/test/capi3.test
+++ b/test/capi3.test
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script testing the callback-free C/C++ API.
#
-# $Id: capi3.test,v 1.50 2007/06/21 15:25:05 drh Exp $
+# $Id: capi3.test,v 1.51 2007/08/12 20:07:59 drh Exp $
#
set testdir [file dirname $argv0]
@@ -310,8 +310,7 @@ proc check_header {STMT test names decltypes} {
proc check_origin_header {STMT test dbs tables cols} {
# If sqlite3_column_origin_name() and friends are not compiled into
# this build, this proc is a no-op.
-ifcapable columnmetadata {
-
+ ifcapable columnmetadata {
# Use the return value of sqlite3_column_count() to build
# a list of column indexes. i.e. If sqlite3_column_count
# is 3, build the list {0 1 2}.
diff --git a/test/exclusive.test b/test/exclusive.test
index 1ce6f6cb2..20e012f8b 100644
--- a/test/exclusive.test
+++ b/test/exclusive.test
@@ -12,7 +12,7 @@
# of these tests is exclusive access mode (i.e. the thing activated by
# "PRAGMA locking_mode = EXCLUSIVE").
#
-# $Id: exclusive.test,v 1.5 2007/04/06 21:42:22 drh Exp $
+# $Id: exclusive.test,v 1.6 2007/08/12 20:07:59 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -197,6 +197,7 @@ do_test exclusive-2.5 {
INSERT INTO abc VALUES(7, 8, 9);
} db2
} {1 {database is locked}}
+sqlite3_soft_heap_limit 0
do_test exclusive-2.6 {
# Because connection 'db' only has a shared-lock, the other connection
# will be able to get a RESERVED, but will fail to upgrade to EXCLUSIVE.
@@ -218,6 +219,7 @@ do_test exclusive-2.8 {
ROLLBACK;
} db2
} {}
+sqlite3_soft_heap_limit $soft_limit
do_test exclusive-2.9 {
# Write the database to establish the exclusive lock with connection 'db.
diff --git a/test/exclusive2.test b/test/exclusive2.test
index f91496f02..d0eeb19b3 100644
--- a/test/exclusive2.test
+++ b/test/exclusive2.test
@@ -10,7 +10,7 @@
#***********************************************************************
# This file implements regression tests for SQLite library.
#
-# $Id: exclusive2.test,v 1.7 2007/07/20 20:25:38 aswift Exp $
+# $Id: exclusive2.test,v 1.8 2007/08/12 20:07:59 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -20,6 +20,11 @@ ifcapable {!pager_pragmas} {
return
}
+# This module does not work right if the cache spills at unexpected
+# moments. So disable the soft-heap-limit.
+#
+sqlite3_soft_heap_limit 0
+
proc pagerChangeCounter {filename {new ""}} {
set fd [open $filename RDWR]
fconfigure $fd -translation binary -encoding binary
@@ -165,7 +170,8 @@ do_test exclusive2-1.11 {
#
# As above, this test is only applicable if the pager cache is
# large enough to hold the entire database. With 1024 byte pages,
-# this means 19 pages.
+# this means 19 pages. We also need to disable the soft-heap-limit
+# to prevent memory-induced cache spills.
#
do_test exclusive2-2.1 {
execsql {PRAGMA locking_mode = exclusive;}
@@ -286,5 +292,6 @@ do_test exclusive2-3.6 {
}
readPagerChangeCounter test.db
} {5}
+sqlite3_soft_heap_limit $soft_limit
finish_test
diff --git a/test/incrblob.test b/test/incrblob.test
index 5cd7040e4..434ac9aaa 100644
--- a/test/incrblob.test
+++ b/test/incrblob.test
@@ -9,7 +9,7 @@
#
#***********************************************************************
#
-# $Id: incrblob.test,v 1.12 2007/06/27 00:36:14 drh Exp $
+# $Id: incrblob.test,v 1.13 2007/08/12 20:07:59 drh Exp $
#
set testdir [file dirname $argv0]
@@ -105,6 +105,8 @@ proc nWrite {db} {
return $stats(write)
}
+sqlite3_soft_heap_limit 0
+
foreach AutoVacuumMode [list 0 1] {
if {$AutoVacuumMode>0} {
@@ -202,6 +204,7 @@ foreach AutoVacuumMode [list 0 1] {
nRead db
} [expr $AutoVacuumMode ? 4 : 30]
}
+sqlite3_soft_heap_limit $soft_limit
#------------------------------------------------------------------------
# incrblob-3.*:
@@ -363,6 +366,7 @@ unset ::text
# after the transaction is commited and the blob channel
# closed.
#
+sqlite3_soft_heap_limit 0
do_test incrblob-6.1 {
sqlite3 db2 test.db
execsql {
@@ -438,6 +442,7 @@ do_test incrblob-6.14 {
}
} {a different invocation}
db2 close
+sqlite3_soft_heap_limit $soft_limit
#-----------------------------------------------------------------------
# The following tests verify the behaviour of the incremental IO
diff --git a/test/lock2.test b/test/lock2.test
index db43d0aba..d071844d0 100644
--- a/test/lock2.test
+++ b/test/lock2.test
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is database locks between competing processes.
#
-# $Id: lock2.test,v 1.7 2007/04/09 11:20:54 danielk1977 Exp $
+# $Id: lock2.test,v 1.8 2007/08/12 20:07:59 drh Exp $
set testdir [file dirname $argv0]
@@ -101,6 +101,7 @@ do_test lock2-1.1 {
do_test lock2-1.1.1 {
execsql {pragma lock_status}
} {main unlocked temp closed}
+sqlite3_soft_heap_limit 0
do_test lock2-1.2 {
execsql {
BEGIN;
@@ -163,5 +164,6 @@ do_test lock2-1.10 {
catch {testfixture $::tf1 {db close}}
catch {close $::tf1}
+sqlite3_soft_heap_limit $soft_limit
finish_test
diff --git a/test/malloc5.test b/test/malloc5.test
index c4148a042..4f5b7fff2 100644
--- a/test/malloc5.test
+++ b/test/malloc5.test
@@ -12,7 +12,7 @@
# This file contains test cases focused on the two memory-management APIs,
# sqlite3_soft_heap_limit() and sqlite3_release_memory().
#
-# $Id: malloc5.test,v 1.11 2007/08/10 16:41:09 drh Exp $
+# $Id: malloc5.test,v 1.12 2007/08/12 20:07:59 drh Exp $
#---------------------------------------------------------------------------
# NOTES ON EXPECTED BEHAVIOUR
@@ -37,6 +37,7 @@ ifcapable !memorymanage {
return
}
+sqlite3_soft_heap_limit 0
sqlite3 db test.db
do_test malloc5-1.1 {
diff --git a/test/pageropt.test b/test/pageropt.test
index b03b6644c..41f3d5cb1 100644
--- a/test/pageropt.test
+++ b/test/pageropt.test
@@ -12,7 +12,7 @@
# The focus of the tests in this file are to verify that the
# pager optimizations implemented in version 3.3.14 work.
#
-# $Id: pageropt.test,v 1.2 2007/04/13 03:23:21 drh Exp $
+# $Id: pageropt.test,v 1.3 2007/08/12 20:07:59 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -51,6 +51,7 @@ proc pagercount_sql {sql {db db}} {
# Setup the test database
#
do_test pageropt-1.1 {
+ sqlite3_soft_heap_limit 0
execsql {
PRAGMA auto_vacuum = OFF;
PRAGMA page_size = 1024;
@@ -195,6 +196,6 @@ do_test pageroot-4.2 {
}
} {12 3 3 0}
-
+sqlite3_soft_heap_limit $soft_limit
catch {db2 close}
finish_test
diff --git a/test/softheap1.test b/test/softheap1.test
index 62231a446..97f5aac34 100644
--- a/test/softheap1.test
+++ b/test/softheap1.test
@@ -13,7 +13,7 @@
# A database corruption bug that occurs in auto_vacuum mode when
# the soft_heap_limit is set low enough to be triggered.
#
-# $Id: softheap1.test,v 1.1 2007/08/10 19:46:44 drh Exp $
+# $Id: softheap1.test,v 1.2 2007/08/12 20:07:59 drh Exp $
set testdir [file dirname $argv0]
@@ -24,10 +24,16 @@ do_test softheap1-1.1 {
execsql {
PRAGMA auto_vacuum=1;
CREATE TABLE t1(x);
- INSERT INTO t1 VALUES(hex(randomblob(5000)));
+ INSERT INTO t1 VALUES(hex(randomblob(1000)));
BEGIN;
+ }
+ execsql {
CREATE TABLE t2 AS SELECT * FROM t1;
+ }
+ execsql {
ROLLBACK;
+ }
+ execsql {
PRAGMA integrity_check;
}
} {ok}