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

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

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. 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
Index: third_party/sqlite/src/test/sync.test
diff --git a/third_party/sqlite/src/test/sync.test b/third_party/sqlite/src/test/sync.test
index 98aa7731e7ddcbfe949a93ed369d012a58bc2455..14252b5c08af33a59917bc79269cced40ed2aacb 100644
--- a/third_party/sqlite/src/test/sync.test
+++ b/third_party/sqlite/src/test/sync.test
@@ -19,32 +19,38 @@ set testdir [file dirname $argv0]
source $testdir/tester.tcl
#
-# These tests are only applicable on unix when pager pragma are
+# These tests are only applicable when pager pragma are
# enabled. Also, since every test uses an ATTACHed database, they
# are only run when ATTACH is enabled.
#
-if {$::tcl_platform(platform)!="unix"} {
- finish_test
- return
-}
ifcapable !pager_pragmas||!attach {
finish_test
return
}
+set sqlite_sync_count 0
+proc cond_incr_sync_count {adj} {
+ global sqlite_sync_count
+ if {$::tcl_platform(platform) == "windows"} {
+ incr sqlite_sync_count $adj
+ } {
+ ifcapable !dirsync {
+ incr sqlite_sync_count $adj
+ }
+ }
+}
+
do_test sync-1.1 {
set sqlite_sync_count 0
- file delete -force test2.db
- file delete -force test2.db-journal
+ forcedelete test2.db
+ forcedelete test2.db-journal
execsql {
PRAGMA fullfsync=OFF;
CREATE TABLE t1(a,b);
ATTACH DATABASE 'test2.db' AS db2;
CREATE TABLE db2.t2(x,y);
}
- ifcapable !dirsync {
- incr sqlite_sync_count 2
- }
+ cond_incr_sync_count 2
set sqlite_sync_count
} 8
ifcapable pager_pragmas {
@@ -58,9 +64,7 @@ ifcapable pager_pragmas {
INSERT INTO t2 VALUES(3,4);
COMMIT;
}
- ifcapable !dirsync {
- incr sqlite_sync_count 3
- }
+ cond_incr_sync_count 3
set sqlite_sync_count
} 8
}
@@ -74,9 +78,7 @@ do_test sync-1.3 {
INSERT INTO t2 VALUES(5,6);
COMMIT;
}
- ifcapable !dirsync {
- incr sqlite_sync_count 3
- }
+ cond_incr_sync_count 3
set sqlite_sync_count
} 10
ifcapable pager_pragmas {

Powered by Google App Engine
This is Rietveld 408576698