Modify the memsubsys1-3.1.4 test so that it does not fail arbitrarily due

to variations in the behavior of system malloc().

FossilOrigin-Name: d280157da0b5275f3e3c875d2dcfb9998d374ac0
This commit is contained in:
drh
2014-08-19 23:04:49 +00:00
parent 5f58ae75c9
commit dfd1547b48
3 changed files with 14 additions and 8 deletions
+7 -1
View File
@@ -124,7 +124,13 @@ do_test memsubsys1-3.1.3 {
} 0
do_test memsubsys1-3.1.4 {
set overflow [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
} $max_pagecache
# Note: The measured PAGECACHE_OVERFLOW is amount malloc() returns, not what
# was requested. System malloc() implementations might (arbitrarily) return
# slightly different oversize buffers, which can result in slightly different
# PAGECACHE_OVERFLOW sizes between consecutive runs. So we cannot do an
# exact comparison. Simply verify that the amount is within 5%.
expr {$overflow>=$max_pagecache*0.95 && $overflow<=$max_pagecache*1.05}
} 1
do_test memsubsys1-3.1.5 {
set s_used [lindex [sqlite3_status SQLITE_STATUS_SCRATCH_USED 0] 2]
} 0