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

Side by Side Diff: third_party/sqlite/src/test/win32nolock.test

Issue 2765553002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
(Empty)
1 # 2016 July 8
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 # This file implements regression tests for SQLite library.
12 #
13
14 if {$tcl_platform(platform)!="windows"} return
15
16 set testdir [file dirname $argv0]
17 source $testdir/tester.tcl
18 set testprefix win32nolock
19
20 do_test win32nolock-1.0 {
21 sqlite3 db test.db
22 execsql {
23 CREATE TABLE t1(a, b);
24 BEGIN;
25 INSERT INTO t1 VALUES(1, 2);
26 }
27 } {}
28
29 do_test win32nolock-1.1 {
30 execsql COMMIT
31 catchsql { SELECT * FROM t1 }
32 } {0 {1 2}}
33
34 db close
35
36 do_test win32nolock-1.2 {
37 sqlite3 db test.db -vfs win32-none
38 sqlite3 db2 test.db -vfs win32-none
39 execsql { PRAGMA mmap_size = 0 } db2
40 execsql {
41 BEGIN;
42 INSERT INTO t1 VALUES(3, 4);
43 }
44 } {}
45
46 do_test win32nolock-1.3 {
47 execsql { SELECT * FROM t1 }
48 } {1 2 3 4}
49
50 do_test win32nolock-1.4 {
51 execsql { SELECT * FROM t1; } db2
52 } {1 2}
53
54 do_test win32nolock-1.5 {
55 execsql {
56 BEGIN;
57 SELECT * FROM t1;
58 } db2
59 } {1 2}
60
61 do_test win32nolock-1.6 {
62 execsql COMMIT
63 execsql {SELECT * FROM t1} db2
64 } {1 2}
65
66 ifcapable memorymanage {
67 do_test win32nolock-1.7 {
68 sqlite3_release_memory 1000000
69 execsql {SELECT * FROM t1} db2
70 } {1 2 3 4}
71 }
72
73 do_test win32nolock-1.8 {
74 db close
75 db2 close
76 } {}
77
78 do_test win32nolock-1.9.1 {
79 sqlite3 db test.db
80 sqlite3 db2 test.db
81 list [catchsql { BEGIN EXCLUSIVE; } db] \
82 [catchsql { BEGIN EXCLUSIVE; } db2]
83 } {{0 {}} {1 {database is locked}}}
84
85 do_test win32nolock-1.9.2 {
86 db close
87 db2 close
88 } {}
89
90 do_test win32nolock-1.10.1 {
91 sqlite3 db test.db -vfs win32-none
92 sqlite3 db2 test.db
93 list [catchsql { BEGIN EXCLUSIVE; } db] \
94 [catchsql { BEGIN EXCLUSIVE; } db2]
95 } {{0 {}} {0 {}}}
96
97 do_test win32nolock-1.10.2 {
98 db close
99 db2 close
100 } {}
101
102 do_test win32nolock-1.11.1 {
103 sqlite3 db test.db
104 sqlite3 db2 test.db -vfs win32-none
105 list [catchsql { BEGIN EXCLUSIVE; } db] \
106 [catchsql { BEGIN EXCLUSIVE; } db2]
107 } {{0 {}} {0 {}}}
108
109 do_test win32nolock-1.11.2 {
110 db close
111 db2 close
112 } {}
113
114 do_test win32nolock-1.12.1 {
115 sqlite3 db test.db -vfs win32-none
116 sqlite3 db2 test.db -vfs win32-none
117 list [catchsql { BEGIN EXCLUSIVE; } db] \
118 [catchsql { BEGIN EXCLUSIVE; } db2]
119 } {{0 {}} {0 {}}}
120
121 do_test win32nolock-1.12.2 {
122 db close
123 db2 close
124 } {}
125
126 finish_test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698