OLD | NEW |
1 # 2009 October 19 | 1 # 2009 October 19 |
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. | 11 # This file implements regression tests for SQLite library. |
12 # | 12 # |
13 | 13 |
14 set testdir [file dirname $argv0] | 14 set testdir [file dirname $argv0] |
15 source $testdir/tester.tcl | 15 source $testdir/tester.tcl |
16 | 16 |
17 if {[info commands sqlite3async_initialize] eq ""} { | 17 if {[info commands sqlite3async_initialize] eq ""} { |
18 # The async logic is not built into this system | 18 # The async logic is not built into this system |
19 finish_test | 19 finish_test |
20 return | 20 return |
21 } | 21 } |
22 | 22 |
23 # Create a database. | 23 # Create a database. |
24 do_test tkt-94c94-1.1 { | 24 do_test tkt-94c94-1.1 { |
25 execsql { CREATE TABLE t1(a, b) } | 25 execsql { CREATE TABLE t1(a, b) } |
26 } {} | 26 } {} |
27 | 27 |
28 # Grow the file to larger than 4096MB (2^32 bytes) | 28 # Grow the file to larger than 4096MB (2^32 bytes) |
29 db close | 29 db close |
30 if {[catch {fake_big_file 4096 [pwd]/test.db} msg]} { | 30 if {[catch {fake_big_file 4096 [get_pwd]/test.db} msg]} { |
31 puts "**** Unable to create a file larger than 4096 MB. *****" | 31 puts "**** Unable to create a file larger than 4096 MB. *****" |
32 finish_test | 32 finish_test |
33 return | 33 return |
34 } | 34 } |
35 | 35 |
36 # Switch to async mode. | 36 # Switch to async mode. |
37 sqlite3async_initialize "" 1 | 37 sqlite3async_initialize "" 1 |
38 sqlite3 db test.db | 38 sqlite3 db test.db |
39 sqlite3 db2 test.db | 39 sqlite3 db2 test.db |
40 | 40 |
41 # Read from and write to the db just past the 4096MB mark. | 41 # Read from and write to the db just past the 4096MB mark. |
42 # | 42 # |
43 do_test tkt-94c94-2.1 { | 43 do_test tkt-94c94-2.1 { |
44 execsql { CREATE TABLE t2(x, y) } db | 44 execsql { CREATE TABLE t2(x, y) } db |
45 } {} | 45 } {} |
46 do_test tkt-94c94-2.2 { | 46 do_test tkt-94c94-2.2 { |
47 breakpoint | |
48 execsql { INSERT INTO t2 VALUES(1, 2) } db2 | 47 execsql { INSERT INTO t2 VALUES(1, 2) } db2 |
49 } {} | 48 } {} |
50 do_test tkt-94c94-2.3 { | 49 do_test tkt-94c94-2.3 { |
51 execsql { SELECT * FROM t2 } db | 50 execsql { SELECT * FROM t2 } db |
52 } {1 2} | 51 } {1 2} |
53 do_test tkt-94c94-2.4 { | 52 do_test tkt-94c94-2.4 { |
54 sqlite3async_control halt idle | 53 sqlite3async_control halt idle |
55 sqlite3async_start | 54 sqlite3async_start |
56 sqlite3async_wait | 55 sqlite3async_wait |
57 } {} | 56 } {} |
58 do_test tkt-94c94-2.5 { | 57 do_test tkt-94c94-2.5 { |
59 execsql { SELECT * FROM t2 } db | 58 execsql { SELECT * FROM t2 } db |
60 } {1 2} | 59 } {1 2} |
61 do_test tkt-94c94-2.6 { | 60 do_test tkt-94c94-2.6 { |
62 sqlite3async_start | 61 sqlite3async_start |
63 sqlite3async_wait | 62 sqlite3async_wait |
64 } {} | 63 } {} |
65 | 64 |
66 db close | 65 db close |
67 db2 close | 66 db2 close |
68 sqlite3async_start | 67 sqlite3async_start |
69 sqlite3async_wait | 68 sqlite3async_wait |
70 sqlite3async_control halt never | 69 sqlite3async_control halt never |
71 sqlite3async_shutdown | 70 sqlite3async_shutdown |
72 | 71 |
73 finish_test | 72 finish_test |
OLD | NEW |