OLD | NEW |
1 # 2010 June 15 | 1 # 2010 June 15 |
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 # | 11 # |
12 | 12 |
13 set testdir [file dirname $argv0] | 13 set testdir [file dirname $argv0] |
14 source $testdir/tester.tcl | 14 source $testdir/tester.tcl |
15 | 15 |
16 set ::testprefix fts3fault | 16 set ::testprefix fts3fault |
17 | 17 |
18 # If SQLITE_ENABLE_FTS3 is not defined, omit this file. | 18 # If SQLITE_ENABLE_FTS3 is not defined, omit this file. |
19 ifcapable !fts3 { finish_test ; return } | 19 ifcapable !fts3 { finish_test ; return } |
20 | 20 |
21 if 1 { | |
22 | |
23 # Test error handling in the sqlite3Fts3Init() function. This is the | 21 # Test error handling in the sqlite3Fts3Init() function. This is the |
24 # function that registers the FTS3 module and various support functions | 22 # function that registers the FTS3 module and various support functions |
25 # with SQLite. | 23 # with SQLite. |
26 # | 24 # |
27 do_faultsim_test 1 -body { | 25 do_faultsim_test 1 -body { |
28 sqlite3 db test.db | 26 sqlite3 db test.db |
29 expr 0 | 27 expr 0 |
30 } -test { | 28 } -test { |
31 catch { db close } | 29 catch { db close } |
32 } | 30 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 execsql { CREATE VIRTUAL TABLE t1 USING fts4(a, b, matchinfo=fts3) } | 137 execsql { CREATE VIRTUAL TABLE t1 USING fts4(a, b, matchinfo=fts3) } |
140 } -test { | 138 } -test { |
141 faultsim_test_result {0 {}} | 139 faultsim_test_result {0 {}} |
142 } | 140 } |
143 do_faultsim_test 7.2 -prep { | 141 do_faultsim_test 7.2 -prep { |
144 faultsim_delete_and_reopen | 142 faultsim_delete_and_reopen |
145 } -body { | 143 } -body { |
146 execsql { CREATE VIRTUAL TABLE t1 USING fts4(a, b, matchinfo=fs3) } | 144 execsql { CREATE VIRTUAL TABLE t1 USING fts4(a, b, matchinfo=fs3) } |
147 } -test { | 145 } -test { |
148 faultsim_test_result {1 {unrecognized matchinfo: fs3}} \ | 146 faultsim_test_result {1 {unrecognized matchinfo: fs3}} \ |
149 {1 {vtable constructor failed: t1}} | 147 {1 {vtable constructor failed: t1}} \ |
| 148 {1 {SQL logic error or missing database}} |
150 } | 149 } |
151 do_faultsim_test 7.3 -prep { | 150 do_faultsim_test 7.3 -prep { |
152 faultsim_delete_and_reopen | 151 faultsim_delete_and_reopen |
153 } -body { | 152 } -body { |
154 execsql { CREATE VIRTUAL TABLE t1 USING fts4(a, b, matchnfo=fts3) } | 153 execsql { CREATE VIRTUAL TABLE t1 USING fts4(a, b, matchnfo=fts3) } |
155 } -test { | 154 } -test { |
156 faultsim_test_result {1 {unrecognized parameter: matchnfo=fts3}} \ | 155 faultsim_test_result {1 {unrecognized parameter: matchnfo=fts3}} \ |
157 {1 {vtable constructor failed: t1}} | 156 {1 {vtable constructor failed: t1}} \ |
158 } | 157 {1 {SQL logic error or missing database}} |
159 | |
160 } | 158 } |
161 | 159 |
162 proc mit {blob} { | 160 proc mit {blob} { |
163 set scan(littleEndian) i* | 161 set scan(littleEndian) i* |
164 set scan(bigEndian) I* | 162 set scan(bigEndian) I* |
165 binary scan $blob $scan($::tcl_platform(byteOrder)) r | 163 binary scan $blob $scan($::tcl_platform(byteOrder)) r |
166 return $r | 164 return $r |
167 } | 165 } |
168 | 166 |
169 do_test 8.0 { | 167 do_test 8.0 { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 } {} | 222 } {} |
225 do_faultsim_test 9.1 -prep { | 223 do_faultsim_test 9.1 -prep { |
226 faultsim_restore_and_reopen | 224 faultsim_restore_and_reopen |
227 } -body { | 225 } -body { |
228 execsql { SELECT offsets(t9) FROM t9 WHERE t9 MATCH 'to*' } | 226 execsql { SELECT offsets(t9) FROM t9 WHERE t9 MATCH 'to*' } |
229 } -test { | 227 } -test { |
230 faultsim_test_result {0 {{0 0 20 39 0 0 64 2}}} | 228 faultsim_test_result {0 {{0 0 20 39 0 0 64 2}}} |
231 } | 229 } |
232 | 230 |
233 finish_test | 231 finish_test |
OLD | NEW |