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

Side by Side Diff: third_party/sqlite/test/async4.test

Issue 3108030: Move bundled copy of sqlite one level deeper to better separate it... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/test/async3.test ('k') | third_party/sqlite/test/async5.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # 2009 April 25
2 #
3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
5 #
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
9 #
10 #***********************************************************************
11 #
12 # $Id: async4.test,v 1.4 2009/06/05 17:09:12 drh Exp $
13
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
16
17 # These tests only work for Tcl version 8.5 and later on Windows (for now)
18 #
19 if {$tcl_platform(platform)=="windows"} {
20 scan $::tcl_version %f vx
21 if {$vx<8.5} {
22 finish_test
23 return
24 }
25 }
26
27 if {[info commands sqlite3async_initialize] eq ""} {
28 # The async logic is not built into this system
29 finish_test
30 return
31 }
32 db close
33
34 # Test layout:
35 #
36 # async4.1.*: Test the lockfiles parameter.
37 # async4.2.*: Test the delay parameter.
38
39 do_test async4.1.1 {
40 sqlite3async_initialize {} 0
41 sqlite3async_control lockfiles
42 } {1}
43 do_test async4.1.2 {
44 sqlite3async_control lockfiles false
45 } {0}
46 do_test async4.1.3 {
47 sqlite3async_control lockfiles
48 } {0}
49 do_test async4.1.4 {
50 sqlite3async_control lockfiles true
51 } {1}
52
53 do_test async4.1.5 {
54 sqlite3 db test.db -vfs sqlite3async
55 execsql { CREATE TABLE t1(a, b, c) }
56 } {}
57 do_test async4.1.6 {
58 list [file exists test.db] [file size test.db]
59 } {1 0}
60 do_test async4.1.7 {
61 sqlite3 db2 test.db
62 catchsql { CREATE TABLE t2(a, b, c) } db2
63 } {1 {database is locked}}
64 do_test async4.1.8 {
65 sqlite3async_control halt idle
66 sqlite3async_start
67 sqlite3async_wait
68 } {}
69 do_test async4.1.9 {
70 catchsql { CREATE TABLE t2(a, b, c) } db2
71 } {0 {}}
72 do_test async4.1.10 {
73 list [catch {sqlite3async_control lockfiles false} msg] $msg
74 } {1 SQLITE_MISUSE}
75 do_test async4.1.11 {
76 db close
77 list [catch {sqlite3async_control lockfiles false} msg] $msg
78 } {1 SQLITE_MISUSE}
79 do_test async4.1.12 {
80 sqlite3async_start
81 sqlite3async_wait
82 sqlite3async_control lockfiles false
83 } {0}
84 do_test async4.1.13 {
85 sqlite3 db test.db -vfs sqlite3async
86 execsql { CREATE TABLE t3(a, b, c) } db
87 } {}
88 do_test async4.1.14 {
89 execsql {
90 CREATE INDEX i1 ON t2(a);
91 CREATE INDEX i2 ON t1(a);
92 } db2
93 } {}
94 do_test async4.1.15 {
95 sqlite3async_start
96 sqlite3async_wait
97 execsql { pragma integrity_check } db2
98 } {{*** in database main ***
99 Page 5 is never used}}
100 do_test async4.1.16 {
101 db close
102 db2 close
103 sqlite3async_start
104 sqlite3async_wait
105 } {}
106 do_test async4.1.17 {
107 sqlite3async_control lockfiles true
108 } {1}
109
110 do_test async4.2.1 {
111 sqlite3async_control delay
112 } {0}
113 do_test async4.2.2 {
114 sqlite3async_control delay 23
115 } {23}
116 do_test async4.2.3 {
117 sqlite3async_control delay
118 } {23}
119 do_test async4.2.4 {
120 sqlite3async_control delay 0
121 } {0}
122 do_test async4.2.5 {
123 sqlite3 db test.db -vfs sqlite3async
124
125 execsql { CREATE TABLE t4(a, b) }
126 set T1 [lindex [time {
127 sqlite3async_start
128 sqlite3async_wait
129 }] 0]
130
131 sqlite3async_control delay 100
132 execsql { CREATE TABLE t5(a, b) }
133 set T2 [lindex [time {
134 sqlite3async_start
135 sqlite3async_wait
136 }] 0]
137
138 expr {($T1+1000000) < $T2}
139 } {1}
140
141 do_test async4.2.6 {
142 sqlite3async_control delay 0
143 execsql { CREATE TABLE t6(a, b) }
144 set T1 [lindex [time {
145 sqlite3async_start
146 sqlite3async_wait
147 }] 0]
148
149 expr {($T1+1000000) < $T2}
150 } {1}
151
152 do_test async4.2.7 {
153 list [catch { sqlite3async_control delay -1 } msg] $msg
154 } {1 SQLITE_MISUSE}
155
156 do_test async4.2.8 {
157 db close
158 sqlite3async_start
159 sqlite3async_wait
160 } {}
161
162 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/test/async3.test ('k') | third_party/sqlite/test/async5.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698