OLD | NEW |
1 # 2010 June 30 | 1 # 2010 June 30 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
11 # This file implements regression tests for SQLite library. The | 11 # This file implements regression tests for SQLite library. The |
12 # focus of this file is testing the sqlite3_unlock_notify() API. | 12 # focus of this file is testing the sqlite3_unlock_notify() API. |
13 # | 13 # |
14 | 14 |
15 set testdir [file dirname $argv0] | 15 set testdir [file dirname $argv0] |
16 source $testdir/tester.tcl | 16 source $testdir/tester.tcl |
17 | 17 |
18 # This script only runs if shared-cache and unlock-notify are available. | 18 # This script only runs if shared-cache and unlock-notify are available. |
19 # | 19 # |
20 ifcapable !unlock_notify||!shared_cache { | 20 ifcapable !unlock_notify||!shared_cache { |
21 finish_test | 21 finish_test |
22 return | 22 return |
23 } | 23 } |
24 | 24 |
25 set esc [sqlite3_enable_shared_cache 1] | 25 set esc [sqlite3_enable_shared_cache 1] |
26 | 26 |
27 sqlite3 db test.db | 27 sqlite3 db test.db |
28 file delete -force test.db2 test.db2-journal test.db2-wal | 28 forcedelete test.db2 test.db2-journal test.db2-wal |
29 sqlite3 db2 test.db2 | 29 sqlite3 db2 test.db2 |
30 | 30 |
31 do_test notify3-1.1 { | 31 do_test notify3-1.1 { |
32 execsql { | 32 execsql { |
33 CREATE TABLE t1(a, b); | 33 CREATE TABLE t1(a, b); |
34 INSERT INTO t1 VALUES('t1 A', 't1 B'); | 34 INSERT INTO t1 VALUES('t1 A', 't1 B'); |
35 } | 35 } |
36 } {} | 36 } {} |
37 do_test notify3-1.2 { | 37 do_test notify3-1.2 { |
38 execsql { | 38 execsql { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 set invoked | 143 set invoked |
144 } [lindex $result 0] | 144 } [lindex $result 0] |
145 } | 145 } |
146 } | 146 } |
147 catch { db1 close } | 147 catch { db1 close } |
148 catch { db2 close } | 148 catch { db2 close } |
149 | 149 |
150 | 150 |
151 sqlite3_enable_shared_cache $esc | 151 sqlite3_enable_shared_cache $esc |
152 finish_test | 152 finish_test |
153 | |
OLD | NEW |