Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Unified Diff: third_party/sqlite/src/test/memsubsys1.test

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/memdb.test ('k') | third_party/sqlite/src/test/memsubsys2.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/memsubsys1.test
diff --git a/third_party/sqlite/src/test/memsubsys1.test b/third_party/sqlite/src/test/memsubsys1.test
index 3bb2cc71d4df3a12d3c0fd794252cc163c07e62f..8cc7c2afc1e7cabae979d575b98b262b9e235711 100644
--- a/third_party/sqlite/src/test/memsubsys1.test
+++ b/third_party/sqlite/src/test/memsubsys1.test
@@ -32,7 +32,7 @@ if {[permutation] == "memsubsys1"} {
#
proc build_test_db {testname pragmas} {
catch {db close}
- file delete -force test.db test.db-journal
+ forcedelete test.db test.db-journal
sqlite3 db test.db
sqlite3_db_config_lookaside db 0 0 0
db eval $pragmas
@@ -68,7 +68,7 @@ proc reset_highwater_marks {} {
sqlite3_status SQLITE_STATUS_PARSER_STACK 1
}
-set xtra_size 256
+set xtra_size 290
# Test 1: Both PAGECACHE and SCRATCH are shut down.
#
@@ -94,12 +94,14 @@ sqlite3_shutdown
sqlite3_config_pagecache [expr 1024+$xtra_size] 20
sqlite3_initialize
reset_highwater_marks
-build_test_db memsubsys1-2 {PRAGMA page_size=1024}
+build_test_db memsubsys1-2 {PRAGMA page_size=1024; PRAGMA mmap_size=0}
#show_memstats
set MEMORY_MANAGEMENT $sqlite_options(memorymanage)
-do_test memsubsys1-2.3 {
- set pg_ovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
-} [expr ($TEMP_STORE>1 || $MEMORY_MANAGEMENT==0)*1024]
+ifcapable !malloc_usable_size {
+ do_test memsubsys1-2.3 {
+ set pg_ovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 2]
+ } [expr ($TEMP_STORE>1 || $MEMORY_MANAGEMENT==0)*1024]
+}
do_test memsubsys1-2.4 {
set pg_used [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0] 2]
} 20
@@ -122,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
« no previous file with comments | « third_party/sqlite/src/test/memdb.test ('k') | third_party/sqlite/src/test/memsubsys2.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698