Index: third_party/sqlite/src/test/malloc_common.tcl |
diff --git a/third_party/sqlite/src/test/malloc_common.tcl b/third_party/sqlite/src/test/malloc_common.tcl |
index b586c88d1f0c91f6785ae2e3e2994163d640b5e7..2d0e57e4fcaf0bac561519f1723172c6a4bfe601 100644 |
--- a/third_party/sqlite/src/test/malloc_common.tcl |
+++ b/third_party/sqlite/src/test/malloc_common.tcl |
@@ -129,6 +129,8 @@ proc do_faultsim_test {name args} { |
set DEFAULT(-test) "" |
set DEFAULT(-install) "" |
set DEFAULT(-uninstall) "" |
+ set DEFAULT(-start) 1 |
+ set DEFAULT(-end) 0 |
fix_testname name |
@@ -146,7 +148,8 @@ proc do_faultsim_test {name args} { |
} |
set testspec [list -prep $O(-prep) -body $O(-body) \ |
- -test $O(-test) -install $O(-install) -uninstall $O(-uninstall) |
+ -test $O(-test) -install $O(-install) -uninstall $O(-uninstall) \ |
+ -start $O(-start) -end $O(-end) |
] |
foreach f [lsort -unique $faultlist] { |
eval do_one_faultsim_test "$name-$f" $FAULTSIM($f) $testspec |
@@ -289,7 +292,7 @@ proc faultsim_test_result_int {args} { |
upvar testrc testrc testresult testresult testnfail testnfail |
set t [list $testrc $testresult] |
set r $args |
- if { ($testnfail==0 && $t != [lindex $r 0]) || [lsearch $r $t]<0 } { |
+ if { ($testnfail==0 && $t != [lindex $r 0]) || [lsearch -exact $r $t]<0 } { |
error "nfail=$testnfail rc=$testrc result=$testresult list=$r" |
} |
} |
@@ -318,6 +321,8 @@ proc faultsim_test_result_int {args} { |
# |
# -test Script to execute after -body. |
# |
+# -start Index of first fault to inject (default 1) |
+# |
proc do_one_faultsim_test {testname args} { |
set DEFAULT(-injectstart) "expr" |
@@ -330,6 +335,8 @@ proc do_one_faultsim_test {testname args} { |
set DEFAULT(-test) "" |
set DEFAULT(-install) "" |
set DEFAULT(-uninstall) "" |
+ set DEFAULT(-start) 1 |
+ set DEFAULT(-end) 0 |
array set O [array get DEFAULT] |
array set O $args |
@@ -346,7 +353,10 @@ proc do_one_faultsim_test {testname args} { |
eval $O(-install) |
set stop 0 |
- for {set iFail 1} {!$stop} {incr iFail} { |
+ for {set iFail $O(-start)} \ |
+ {!$stop && ($O(-end)==0 || $iFail<=$O(-end))} \ |
+ {incr iFail} \ |
+ { |
# Evaluate the -prep script. |
# |