OLD | NEW |
1 # 2008 July 9 | 1 # 2008 July 9 |
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 specifically focuses | 14 # segfault if it sees a corrupt database file. It specifically focuses |
15 # on corruption in the form of duplicate entries on the freelist. | 15 # on corruption in the form of duplicate entries on the freelist. |
16 # | 16 # |
17 # $Id: corrupt9.test,v 1.3 2009/06/04 02:47:04 shane Exp $ | 17 # $Id: corrupt9.test,v 1.3 2009/06/04 02:47:04 shane Exp $ |
18 | 18 |
19 set testdir [file dirname $argv0] | 19 set testdir [file dirname $argv0] |
20 source $testdir/tester.tcl | 20 source $testdir/tester.tcl |
21 | 21 |
| 22 # Do not use a codec for tests in this file, as the database file is |
| 23 # manipulated directly using tcl scripts (using the [hexio_write] command). |
| 24 # |
| 25 do_not_use_codec |
| 26 |
22 # We must have the page_size pragma for these tests to work. | 27 # We must have the page_size pragma for these tests to work. |
23 # | 28 # |
24 ifcapable !pager_pragmas { | 29 ifcapable !pager_pragmas { |
25 finish_test | 30 finish_test |
26 return | 31 return |
27 } | 32 } |
28 | 33 |
29 # Return the offset to the first (trunk) page of the freelist. Return | 34 # Return the offset to the first (trunk) page of the freelist. Return |
30 # zero of the freelist is empty. | 35 # zero of the freelist is empty. |
31 # | 36 # |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } {1} | 127 } {1} |
123 do_test corrupt9-4.2 { | 128 do_test corrupt9-4.2 { |
124 catchsql { | 129 catchsql { |
125 CREATE INDEX i2 ON t2(b,a); | 130 CREATE INDEX i2 ON t2(b,a); |
126 REINDEX; | 131 REINDEX; |
127 } | 132 } |
128 } {1 {database disk image is malformed}} | 133 } {1 {database disk image is malformed}} |
129 | 134 |
130 | 135 |
131 finish_test | 136 finish_test |
OLD | NEW |