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

Fix a test bug introduce with the previous commit. (CVS 2203)

FossilOrigin-Name: 1c19e8bdca24484fcb9f068b38ebfbce3e24ada5
This commit is contained in:
danielk1977
2005-01-12 13:04:54 +00:00
parent 4397de57ce
commit 656152c2e3
4 changed files with 26 additions and 17 deletions

View File

@ -14,7 +14,7 @@
# special feature is used to see what happens in the library if a malloc
# were to really fail due to an out-of-memory situation.
#
# $Id: malloc.test,v 1.16 2005/01/12 12:44:04 danielk1977 Exp $
# $Id: malloc.test,v 1.17 2005/01/12 13:04:55 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -34,8 +34,21 @@ if {[info command sqlite_malloc_stat]==""} {
#
# -tclprep TCL script to run to prepare test.
# -sqlprep SQL script to run to prepare test.
# -tclbody TCL script to run with IO error simulation.
# -sqlbody TCL script to run with IO error simulation.
# -tclbody TCL script to run with malloc failure simulation.
# -sqlbody TCL script to run with malloc failure simulation.
#
# This command runs a series of tests to verify SQLite's ability
# to handle an out-of-memory condition gracefully. It is assumed
# that if this condition occurs a malloc() call will return a
# NULL pointer. Linux, for example, doesn't do that by default. See
# the "BUGS" section of malloc(3).
#
# Each iteration of a loop, the TCL commands in any argument passed
# to the -tclbody switch, followed by the SQL commands in any argument
# passed to the -sqlbody switch are executed. Each iteration the
# Nth call to sqliteMalloc() is made to fail, where N is increased
# each time the loop runs starting from 1. When all commands execute
# successfully, the loop ends.
#
proc do_malloc_test {tn args} {
array set ::mallocopts $args
@ -85,8 +98,6 @@ proc do_malloc_test {tn args} {
}
}
if 0 {
for {set go 1; set i 1} {$go} {incr i} {
do_test malloc-1.$i {
sqlite_malloc_fail 0
@ -461,8 +472,6 @@ do_malloc_test 9 -sqlprep {
COMMIT;
}
}
# This block tests malloc() failures that occur while opening a
# connection to a database.
do_malloc_test 10 -sqlprep {

View File

@ -13,7 +13,7 @@
# caused by an ON CONFLICT ROLLBACK clause aborts any other pending
# statements.
#
# $Id: rollback.test,v 1.1 2004/06/30 11:14:19 drh Exp $
# $Id: rollback.test,v 1.2 2005/01/12 13:04:55 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -64,7 +64,7 @@ do_test rollback-1.5 {
#
do_test rollback-1.6 {
sqlite3_reset $STMT
} {}
} {SQLITE_OK}
do_test rollback-1.7 {
sqlite3_step $STMT
} {SQLITE_ROW}