Fixes to malloc3.test so that it can run in transient or persistent failure mode. (CVS 4336)
FossilOrigin-Name: e14e3688eb64577a2a7070e4e47e715a5d7d5089
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
C Bug\sfixes\sin\sthe\smutex\sheader\sfile.\s\sTickets\s#2599\sand\s#2600.\s(CVS\s4335)
|
||||
D 2007-08-30T14:10:30
|
||||
C Fixes\sto\smalloc3.test\sso\sthat\sit\scan\srun\sin\stransient\sor\spersistent\sfailure\smode.\s(CVS\s4336)
|
||||
D 2007-08-30T14:41:34
|
||||
F Makefile.in bfcc303429a5d9dcd552d807ee016c77427418c3
|
||||
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
|
||||
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
||||
@@ -347,7 +347,7 @@ F test/lock4.test 49e22396b9be6e047b3d35469f233be79153c9d5
|
||||
F test/main.test e7212ce1023957c7209778cc87fa932bd79ba89a
|
||||
F test/malloc.test 52306f056e7359e68ed2e204f37f47a0e2020c57
|
||||
F test/malloc2.test c1a74f46a3581b56df29ff46a4e1c99b41c44ad9
|
||||
F test/malloc3.test 95211d9b2394252cacf836c62fd3d405c58f73bd
|
||||
F test/malloc3.test ca656197fe627d006012f50f084a712bf154f0bb
|
||||
F test/malloc4.test 08830f5964a95f5a75218f56e7742e5dbe482e53
|
||||
F test/malloc5.test 9db9205a5d444e23043368f961f92641c7770199
|
||||
F test/malloc6.test 3733b9bd4e039c3239f869c40edbb88172025e2e
|
||||
@@ -568,7 +568,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
|
||||
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
||||
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
||||
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
|
||||
P d3e502263808c1fe0487fda02f16adcbb1279183
|
||||
R 8ab4e043a311e4bca4b56b1d50a59fcc
|
||||
U drh
|
||||
Z 20709391f71da3ae2883ec1a97c7dd8d
|
||||
P 4bdfe1419c536fec5b3c0a7fbe3d0ff52f183f43
|
||||
R ef8c07e08dd9f512fe2fb64c573a68e8
|
||||
U danielk1977
|
||||
Z 77487b8985e6f89316a2736312affc63
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
4bdfe1419c536fec5b3c0a7fbe3d0ff52f183f43
|
||||
e14e3688eb64577a2a7070e4e47e715a5d7d5089
|
||||
+17
-9
@@ -13,7 +13,7 @@
|
||||
# correctly. The emphasis of these tests are the _prepare(), _step() and
|
||||
# _finalize() calls.
|
||||
#
|
||||
# $Id: malloc3.test,v 1.12 2007/08/29 12:31:29 danielk1977 Exp $
|
||||
# $Id: malloc3.test,v 1.13 2007/08/30 14:41:34 danielk1977 Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -177,7 +177,7 @@ proc SQL {a1 {a2 ""}} {
|
||||
# argument is either 1 or 0, the expected value of the auto-commit flag.
|
||||
#
|
||||
proc TEST_AUTOCOMMIT {id a} {
|
||||
TEST $id "do_test \$testid { sqlite3_get_autocommit $::DB } {$a}"
|
||||
TEST $id "do_test \$testid { sqlite3_get_autocommit \$::DB } {$a}"
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
@@ -519,7 +519,7 @@ SQL COMMIT
|
||||
# End of test program declaration
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
proc run_test {arglist {pcstart 0} {iFailStart 1}} {
|
||||
proc run_test {arglist iRepeat {pcstart 0} {iFailStart 1}} {
|
||||
if {[llength $arglist] %2} {
|
||||
error "Uneven number of arguments to TEST"
|
||||
}
|
||||
@@ -560,11 +560,10 @@ proc run_test {arglist {pcstart 0} {iFailStart 1}} {
|
||||
set ::rollback_hook_count 0
|
||||
|
||||
set ac [sqlite3_get_autocommit $::DB] ;# Auto-Commit
|
||||
sqlite3_memdebug_fail $iFail -repeat 1
|
||||
sqlite3_memdebug_fail $iFail -repeat 0
|
||||
set rc [catch {db eval [lindex $v 1]} msg] ;# True error occurs
|
||||
set nac [sqlite3_get_autocommit $::DB] ;# New Auto-Commit
|
||||
|
||||
|
||||
if {$rc != 0 && $nac && !$ac} {
|
||||
# Before [db eval] the auto-commit flag was clear. Now it
|
||||
# is set. Since an error occured we assume this was not a
|
||||
@@ -634,12 +633,21 @@ proc run_test {arglist {pcstart 0} {iFailStart 1}} {
|
||||
}
|
||||
}
|
||||
|
||||
# Turn of the Tcl interface's prepared statement caching facility.
|
||||
# Turn of the Tcl interface's prepared statement caching facility. Then
|
||||
# run the tests with "persistent" malloc failures.
|
||||
db cache size 0
|
||||
run_test $::run_test_script 1
|
||||
|
||||
run_test $::run_test_script 9 1
|
||||
# run_test [lrange $::run_test_script 0 3] 0 63
|
||||
sqlite3_memdebug_fail -1
|
||||
# Close and reopen the db.
|
||||
db close
|
||||
file delete -force test.db test.db-journal
|
||||
sqlite3 db test.db
|
||||
set ::DB [sqlite3_connection_pointer db]
|
||||
|
||||
# Turn of the Tcl interface's prepared statement caching facility in
|
||||
# the new connnection. Then run the tests with "transient" malloc failures.
|
||||
db cache size 0
|
||||
run_test $::run_test_script 0
|
||||
|
||||
sqlite3_memdebug_fail -1
|
||||
finish_test
|
||||
|
||||
Reference in New Issue
Block a user