1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Enhance tester.tcl so that when "--malloctrace=1" is specified, the test

generates self-contained Tcl scripts that present GUIs instead of *.sql files
that require a separate program to interpret.

FossilOrigin-Name: de2e3cbd08c00d235106c040fa472ec267ef8f1ec13c34ed7d16deac8d50b6cc
This commit is contained in:
dan
2018-09-18 17:00:06 +00:00
parent b1e1a0fd2d
commit 253c6ee1bf
16 changed files with 329 additions and 88 deletions

View File

@ -3757,25 +3757,23 @@ do_test printf-15.3 {
# Now test malloc() failure within a sqlite3_mprintf():
#
ifcapable memdebug {
foreach var {a b c d} {
set $var [string repeat $var 400]
}
set str1 "[string repeat A 360]%d%d%s"
set str2 [string repeat B 5000]
set zSuccess "[string repeat A 360]11[string repeat B 5000]"
foreach ::iRepeat {0 1} {
set nTestNum 1
while {1} {
sqlite3_memdebug_fail $nTestNum -repeat $::iRepeat
set z [sqlite3_mprintf_str $str1 1 1 $str2]
set nFail [sqlite3_memdebug_fail -1 -benign nBenign]
do_test printf-malloc-$::iRepeat.$nTestNum {
expr {($nFail>0 && $z eq "") || ($nFail==$nBenign && $z eq $zSuccess)}
} {1}
if {$nFail == 0} break
incr nTestNum
}
foreach var {a b c d} {
set $var [string repeat $var 400]
}
set str1 "[string repeat A 360]%d%d%s"
set str2 [string repeat B 5000]
set zSuccess "[string repeat A 360]11[string repeat B 5000]"
foreach ::iRepeat {0 1} {
set nTestNum 1
while {1} {
sqlite3_memdebug_fail $nTestNum -repeat $::iRepeat
set z [sqlite3_mprintf_str $str1 1 1 $str2]
set nFail [sqlite3_memdebug_fail -1 -benign nBenign]
do_test printf-malloc-$::iRepeat.$nTestNum {
expr {($nFail>0 && $z eq "") || ($nFail==$nBenign && $z eq $zSuccess)}
} {1}
if {$nFail == 0} break
incr nTestNum
}
}