1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Fixes so that compiling and testing works when SQLITE_OMIT_AUTOVACUUM is defined. (CVS 2218)

FossilOrigin-Name: fe548561a0e7a696fd453372f4427cf3e3f19d20
This commit is contained in:
danielk1977
2005-01-16 09:06:33 +00:00
parent 79a40da6d7
commit 4e17d14c63
9 changed files with 50 additions and 39 deletions

View File

@ -12,10 +12,18 @@
# This file runs the tests in the file crash.test with auto-vacuum enabled
# databases.
#
# $Id: autovacuum_crash.test,v 1.1 2004/11/08 09:51:09 danielk1977 Exp $
# $Id: autovacuum_crash.test,v 1.2 2005/01/16 09:06:34 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# If this build of the library does not support auto-vacuum, omit this
# whole file.
ifcapable {!autovacuum} {
finish_test
return
}
rename finish_test really_finish_test2
proc finish_test {} {}
set ISQUICK 1

View File

@ -12,10 +12,18 @@
# This file runs the tests in the file crash.test with auto-vacuum enabled
# databases.
#
# $Id: autovacuum_ioerr.test,v 1.1 2005/01/11 10:25:07 danielk1977 Exp $
# $Id: autovacuum_ioerr.test,v 1.2 2005/01/16 09:06:34 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# If this build of the library does not support auto-vacuum, omit this
# whole file.
ifcapable {!autovacuum} {
finish_test
return
}
rename finish_test really_finish_test2
proc finish_test {} {}
set ISQUICK 1

View File

@ -15,11 +15,18 @@
# The tests in this file use special facilities that are only
# available in the SQLite test fixture.
#
# $Id: autovacuum_ioerr2.test,v 1.2 2005/01/15 12:45:51 danielk1977 Exp $
# $Id: autovacuum_ioerr2.test,v 1.3 2005/01/16 09:06:34 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
# If this build of the library does not support auto-vacuum, omit this
# whole file.
ifcapable {!autovacuum} {
finish_test
return
}
proc opendb {} {
catch {file delete -force test.db}
catch {file delete -force test.db-journal}

View File

@ -20,7 +20,7 @@
# The special crash-test module with its os_test.c backend only works
# on Unix.
#
# $Id: crash.test,v 1.15 2005/01/15 12:45:51 danielk1977 Exp $
# $Id: crash.test,v 1.16 2005/01/16 09:06:34 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -68,11 +68,6 @@ proc signature2 {} {
return [db eval {SELECT count(*), md5sum(a), md5sum(b), md5sum(c) FROM abc2}]
}
# This variable is set to 1 if the databases being used support auto-vacuum.
# This is because some of the tests in this file verify file-size, which is
# slightly larger for auto-vacuum databases.
set AUTOVACUUM [db eval {pragma auto_vacuum}]
#--------------------------------------------------------------------------
# Simple crash test:
#
@ -350,7 +345,7 @@ do_test crash-5.1 {
} {}
do_test crash-5.2 {
expr [file size test.db] / 1024
} [expr $AUTOVACUUM ? 11 : 10]
} [expr [string match [execsql {pragma auto_vacuum}] 1] ? 11 : 10]
set sig [signature]
do_test crash-5.3 {
# The SQL below is used to expose a bug that existed in
@ -427,9 +422,4 @@ do_test crash-7.2 {
signature
} $sig
# The AUTOVACUUM was changed above. We have to reset it for
# other scripts that run as part of "fulltest"
#
set AUTOVACUUM $sqlite_options(default_autovacuum)
finish_test

View File

@ -15,13 +15,11 @@
# The tests in this file use special facilities that are only
# available in the SQLite test fixture.
#
# $Id: ioerr.test,v 1.13 2005/01/14 13:50:13 danielk1977 Exp $
# $Id: ioerr.test,v 1.14 2005/01/16 09:06:34 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set ::AV [execsql {pragma auto_vacuum}]
# Usage: do_ioerr_test <test number> <options...>
#
# The first argument, <test number>, is an integer used to name the
@ -110,7 +108,7 @@ do_ioerr_test 1 -sqlprep {
COMMIT;
SELECT * FROM t1;
DELETE FROM t1 WHERE a<100;
} -exclude [expr [execsql {pragma auto_vacuum}] ? 8 : 0]
} -exclude [expr [string match [execsql {pragma auto_vacuum}] 1] ? 8 : 0]
proc cksum {{db db}} {
@ -228,7 +226,7 @@ do_ioerr_test 5 -sqlprep {
CREATE TABLE t1(a,b,c);
CREATE TABLE test2.t2(a,b,c);
COMMIT;
} -exclude [expr [execsql {pragma auto_vacuum}] ? 8 : 0]
} -exclude [expr [string match [execsql {pragma auto_vacuum}] 1] ? 8 : 0]
# Test IO errors when replaying two hot journals from a 2-file
# transaction. This test only runs on UNIX.
@ -286,5 +284,3 @@ do_ioerr_test 14 -tclprep {
finish_test

View File

@ -13,7 +13,7 @@
# This file implements tests for the SQLITE_MISUSE detection logic.
# This test file leaks memory and file descriptors.
#
# $Id: misuse.test,v 1.8 2004/11/14 21:56:31 drh Exp $
# $Id: misuse.test,v 1.9 2005/01/16 09:06:34 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -40,6 +40,7 @@ proc catchsql2 {sql} {
do_test misuse-1.1 {
db close
catch {file delete -force test2.db}
catch {file delete -force test2.db-journal}
set ::DB [sqlite3 db test2.db]
execsql {
CREATE TABLE t1(a,b);