OLD | NEW |
1 # 2010 October 29 | 1 # 2010 October 29 |
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 #*********************************************************************** |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } {} | 188 } {} |
189 do_test multiplex-2.2.3 { file size [multiplex_name test.x 0] } {6144} | 189 do_test multiplex-2.2.3 { file size [multiplex_name test.x 0] } {6144} |
190 | 190 |
191 do_test multiplex-2.3.1 { | 191 do_test multiplex-2.3.1 { |
192 sqlite3 db2 test2.x | 192 sqlite3 db2 test2.x |
193 db2 close | 193 db2 close |
194 } {} | 194 } {} |
195 | 195 |
196 | 196 |
197 unset -nocomplain ::log | 197 unset -nocomplain ::log |
198 do_test multiplex-2.4.1 { | 198 #do_test multiplex-2.4.1 { |
199 sqlite3_multiplex_shutdown | 199 # sqlite3_multiplex_shutdown |
200 } {SQLITE_MISUSE} | 200 #} {SQLITE_MISUSE} |
201 do_test multiplex-2.4.2 { | 201 do_test multiplex-2.4.2 { |
202 execsql { INSERT INTO t1 VALUES(3, randomblob(1100)) } | 202 execsql { INSERT INTO t1 VALUES(3, randomblob(1100)) } |
203 } {} | 203 } {} |
204 do_test multiplex-2.4.3 { | 204 #do_test multiplex-2.4.3 { |
205 set ::log | 205 # set ::log |
206 } {SQLITE_MISUSE {sqlite3_multiplex_shutdown() called while database connections
are still open}} | 206 #} {SQLITE_MISUSE {sqlite3_multiplex_shutdown() called while database connection
s are still open}} |
| 207 |
207 do_test multiplex-2.4.4 { file size [multiplex_name test.x 0] } {7168} | 208 do_test multiplex-2.4.4 { file size [multiplex_name test.x 0] } {7168} |
208 do_test multiplex-2.4.5 { | 209 do_test multiplex-2.4.5 { |
209 db close | 210 db close |
210 sqlite3 db test.x | 211 sqlite3 db test.x |
211 db eval vacuum | 212 db eval vacuum |
212 db close | 213 db close |
213 glob test.x* | 214 glob test.x* |
214 } {test.x} | 215 } {test.x} |
215 do_test multiplex-2.4.99 { | 216 do_test multiplex-2.4.99 { |
216 sqlite3_multiplex_shutdown | 217 sqlite3_multiplex_shutdown |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } {} | 439 } {} |
439 | 440 |
440 #------------------------------------------------------------------------- | 441 #------------------------------------------------------------------------- |
441 # | 442 # |
442 | 443 |
443 sqlite3_multiplex_initialize "" 1 | 444 sqlite3_multiplex_initialize "" 1 |
444 multiplex_set db main 32768 16 | 445 multiplex_set db main 32768 16 |
445 | 446 |
446 # Return a list of all currently defined multiplexs. | 447 # Return a list of all currently defined multiplexs. |
447 proc multiplex_list {} { | 448 proc multiplex_list {} { |
448 set allq {} | 449 glob -nocomplain test2.db* |
449 foreach q [sqlite3_multiplex_dump] { | |
450 lappend allq [lindex $q 0] | |
451 } | |
452 return [lsort $allq] | |
453 } | 450 } |
454 | 451 |
455 do_test multiplex-4.1.6 { | 452 do_test multiplex-4.1.6 { |
456 multiplex_delete test2.db | 453 multiplex_delete test2.db |
457 sqlite3 db test2.db | 454 sqlite3 db test2.db |
458 db eval {CREATE TABLE t2(x); INSERT INTO t2 VALUES('tab-t2');} | 455 db eval {CREATE TABLE t2(x); INSERT INTO t2 VALUES('tab-t2');} |
459 set res [multiplex_list] | 456 set res [multiplex_list] |
460 list [regexp {test2.db} $res] | 457 list [regexp {test2.db} $res] |
461 } {1} | 458 } {1} |
462 do_test multiplex-4.1.6a { | 459 do_test multiplex-4.1.6a { |
(...skipping 24 matching lines...) Expand all Loading... |
487 list [regexp {test2.db} $res] | 484 list [regexp {test2.db} $res] |
488 } {1} | 485 } {1} |
489 do_test multiplex-4.1.11 { | 486 do_test multiplex-4.1.11 { |
490 db2 close | 487 db2 close |
491 set res [multiplex_list] | 488 set res [multiplex_list] |
492 list [regexp {test2.db} $res] | 489 list [regexp {test2.db} $res] |
493 } {1} | 490 } {1} |
494 do_test multiplex-4.1.12 { | 491 do_test multiplex-4.1.12 { |
495 db close | 492 db close |
496 multiplex_list | 493 multiplex_list |
497 } {} | 494 } {test2.db} |
498 | 495 |
499 | 496 |
500 #------------------------------------------------------------------------- | 497 #------------------------------------------------------------------------- |
501 # The following tests test that the multiplex VFS handles malloc and IO | 498 # The following tests test that the multiplex VFS handles malloc and IO |
502 # errors. | 499 # errors. |
503 # | 500 # |
504 | 501 |
505 sqlite3_multiplex_initialize "" 1 | 502 sqlite3_multiplex_initialize "" 1 |
506 multiplex_set db main 32768 16 | 503 multiplex_set db main 32768 16 |
507 | 504 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 | 589 |
593 } | 590 } |
594 | 591 |
595 | 592 |
596 catch { db close } | 593 catch { db close } |
597 catch { sqlite3_multiplex_shutdown } | 594 catch { sqlite3_multiplex_shutdown } |
598 sqlite3_shutdown | 595 sqlite3_shutdown |
599 test_sqlite3_log | 596 test_sqlite3_log |
600 sqlite3_initialize | 597 sqlite3_initialize |
601 finish_test | 598 finish_test |
OLD | NEW |