OLD | NEW |
1 # 2007 April 6 | 1 # 2007 April 6 |
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. | 14 # segfault if it sees a corrupt database file. |
15 # | 15 # |
16 # $Id: corrupt3.test,v 1.2 2007/04/06 21:42:22 drh Exp $ | 16 # $Id: corrupt3.test,v 1.2 2007/04/06 21:42:22 drh Exp $ |
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 if {[sqlite3 -has-codec]} { finish_test ; return } |
| 22 |
21 # We must have the page_size pragma for these tests to work. | 23 # We must have the page_size pragma for these tests to work. |
22 # | 24 # |
23 ifcapable !pager_pragmas { | 25 ifcapable !pager_pragmas { |
24 finish_test | 26 finish_test |
25 return | 27 return |
26 } | 28 } |
27 | 29 |
28 # Create a database with an overflow page. | 30 # Create a database with an overflow page. |
29 # | 31 # |
30 do_test corrupt3-1.1 { | 32 do_test corrupt3-1.1 { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } [list 1 {database disk image is malformed}] | 102 } [list 1 {database disk image is malformed}] |
101 do_test corrupt3-1.12 { | 103 do_test corrupt3-1.12 { |
102 catchsql { | 104 catchsql { |
103 PRAGMA integrity_check | 105 PRAGMA integrity_check |
104 } | 106 } |
105 } {0 {{*** in database main *** | 107 } {0 {{*** in database main *** |
106 On tree page 2 cell 0: 1 of 1 pages missing from overflow list starting at 0 | 108 On tree page 2 cell 0: 1 of 1 pages missing from overflow list starting at 0 |
107 Page 3 is never used}}} | 109 Page 3 is never used}}} |
108 | 110 |
109 finish_test | 111 finish_test |
OLD | NEW |