OLD | NEW |
1 # 2010 February 18 | 1 # 2010 February 18 |
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 # This file implements tests to make sure SQLite does not crash or | 13 # This file implements tests to make sure SQLite does not crash or |
14 # segfault if it sees a corrupt database file. It specifcally | 14 # segfault if it sees a corrupt database file. It specifcally |
15 # focuses on rowid order corruption. | 15 # focuses on rowid order corruption. |
16 # | 16 # |
17 | 17 |
18 set testdir [file dirname $argv0] | 18 set testdir [file dirname $argv0] |
19 source $testdir/tester.tcl | 19 source $testdir/tester.tcl |
20 | 20 |
21 # Do not use a codec for tests in this file, as the database file is | 21 # This module uses hard-coded offsets which do not work if the reserved_bytes |
22 # manipulated directly using tcl scripts (using the [hexio_write] command). | 22 # value is nonzero. |
23 # | 23 if {[nonzero_reserved_bytes]} {finish_test; return;} |
24 do_not_use_codec | |
25 | 24 |
26 # These tests deal with corrupt database files | 25 # These tests deal with corrupt database files |
27 # | 26 # |
28 database_may_be_corrupt | 27 database_may_be_corrupt |
29 | 28 |
30 # Do not run the tests in this file if ENABLE_OVERSIZE_CELL_CHECK is on. | 29 # Do not run the tests in this file if ENABLE_OVERSIZE_CELL_CHECK is on. |
31 # | 30 # |
32 ifcapable oversize_cell_check { | 31 ifcapable oversize_cell_check { |
33 finish_test | 32 finish_test |
34 return | 33 return |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 hexio_write test.db [lindex $test 0] [format %02x [lindex $test 1]] | 143 hexio_write test.db [lindex $test 0] [format %02x [lindex $test 1]] |
145 | 144 |
146 sqlite3 db test.db | 145 sqlite3 db test.db |
147 | 146 |
148 catchsql {PRAGMA integrity_check} | 147 catchsql {PRAGMA integrity_check} |
149 } {/out of order/} | 148 } {/out of order/} |
150 incr tc 1 | 149 incr tc 1 |
151 } | 150 } |
152 | 151 |
153 finish_test | 152 finish_test |
OLD | NEW |