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

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

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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/lock_common.tcl ('k') | third_party/sqlite/src/test/main.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/lookaside.test
diff --git a/third_party/sqlite/src/test/lookaside.test b/third_party/sqlite/src/test/lookaside.test
index 3c445604e45d7a31336a4572894973ab7125f647..0b239a04d5e1c0bd57b73e24d2c05cfe379f922e 100644
--- a/third_party/sqlite/src/test/lookaside.test
+++ b/third_party/sqlite/src/test/lookaside.test
@@ -21,6 +21,14 @@ ifcapable !lookaside {
return
}
+# The tests in this file configure the lookaside allocator after a
+# connection is opened. This will not work if there is any "presql"
+# configured (SQL run within the [sqlite3] wrapper in tester.tcl).
+if {[info exists ::G(perm:presql)]} {
+ finish_test
+ return
+}
+
catch {db close}
sqlite3_shutdown
sqlite3_config_pagecache 0 0
@@ -34,38 +42,52 @@ sqlite3 db test.db
do_test lookaside-1.1 {
catch {sqlite3_config_error db}
} {0}
+
do_test lookaside-1.2 {
sqlite3_db_config_lookaside db 1 18 18
} {0}
-do_test lookaside-1.3 {
- sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 0
+do_test lookaside-1.3.1 {
+ sqlite3_db_status db DBSTATUS_LOOKASIDE_USED 0
} {0 0 0}
+do_test lookaside-1.3.2 {
+ sqlite3_db_status db DBSTATUS_LOOKASIDE_HIT 0
+} {0 0 0}
+do_test lookaside-1.3.3 {
+ sqlite3_db_status db DBSTATUS_LOOKASIDE_MISS_SIZE 0
+} {0 0 0}
+do_test lookaside-1.3.4 {
+ sqlite3_db_status db DBSTATUS_LOOKASIDE_MISS_FULL 0
+} {0 0 0}
+
do_test lookaside-1.4 {
db eval {CREATE TABLE t1(w,x,y,z);}
- foreach {x y z} [sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 0] break
- expr {$x==0 && $y<$z && $z==18}
+ foreach {x y z} [sqlite3_db_status db DBSTATUS_LOOKASIDE_USED 0] break
+ set p [lindex [sqlite3_db_status db DBSTATUS_LOOKASIDE_HIT 0] 2]
+ set q [lindex [sqlite3_db_status db DBSTATUS_LOOKASIDE_MISS_SIZE 0] 2]
+ set r [lindex [sqlite3_db_status db DBSTATUS_LOOKASIDE_MISS_FULL 0] 2]
+ expr {$x==0 && $y<$z && $z==18 && $p>0 && $q>0 && $r>0}
} {0}
do_test lookaside-1.5 {
- foreach {x y z} [sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 1] break
+ foreach {x y z} [sqlite3_db_status db DBSTATUS_LOOKASIDE_USED 1] break
expr {$x==0 && $y<$z && $z==18}
} {0}
do_test lookaside-1.6 {
- foreach {x y z} [sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 0] break
+ foreach {x y z} [sqlite3_db_status db DBSTATUS_LOOKASIDE_USED 0] break
expr {$x==0 && $y==$z && $y<18}
} {1}
do_test lookaside-1.7 {
db cache flush
- foreach {x y z} [sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 0] break
+ foreach {x y z} [sqlite3_db_status db DBSTATUS_LOOKASIDE_USED 0] break
expr {$x==0 && $y==0 && $z<18}
} {1}
do_test lookaside-1.8 {
db cache flush
- foreach {x y z} [sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 1] break
+ foreach {x y z} [sqlite3_db_status db DBSTATUS_LOOKASIDE_USED 1] break
expr {$x==0 && $y==0 && $z<18}
} {1}
do_test lookaside-1.9 {
db cache flush
- sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 0
+ sqlite3_db_status db DBSTATUS_LOOKASIDE_USED 0
} {0 0 0}
do_test lookaside-2.1 {
@@ -73,7 +95,7 @@ do_test lookaside-2.1 {
} {0}
do_test lookaside-2.2 {
db eval {CREATE TABLE t2(x);}
- foreach {x y z} [sqlite3_db_status db SQLITE_DBSTATUS_LOOKASIDE_USED 0] break
+ foreach {x y z} [sqlite3_db_status db DBSTATUS_LOOKASIDE_USED 0] break
expr {$x==0 && $y<$z && $z>10 && $z<100}
} {1}
do_test lookaside-2.3 {
« no previous file with comments | « third_party/sqlite/src/test/lock_common.tcl ('k') | third_party/sqlite/src/test/main.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698