| OLD | NEW |
| 1 # 2007 May 10 | 1 # 2007 May 10 |
| 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. The focus | 11 # This file implements regression tests for SQLite library. The focus |
| 12 # of this file is checking the libraries response to subtly corrupting | 12 # of this file is checking the libraries response to subtly corrupting |
| 13 # the database file by changing the values of pseudo-randomly selected | 13 # the database file by changing the values of pseudo-randomly selected |
| 14 # bytes. | 14 # bytes. |
| 15 # | 15 # |
| 16 # $Id: fuzz3.test,v 1.3 2009/01/05 17:19:03 drh Exp $ | 16 # $Id: fuzz3.test,v 1.3 2009/01/05 17:19:03 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 # These tests deal with corrupt database files |
| 22 # |
| 23 database_may_be_corrupt |
| 21 | 24 |
| 22 expr srand(123) | 25 expr srand(123) |
| 23 | 26 |
| 24 proc rstring {n} { | 27 proc rstring {n} { |
| 25 set str s | 28 set str s |
| 26 while {[string length $str] < $n} { | 29 while {[string length $str] < $n} { |
| 27 append str [expr rand()] | 30 append str [expr rand()] |
| 28 } | 31 } |
| 29 return [string range $str 0 $n] | 32 return [string range $str 0 $n] |
| 30 } | 33 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 # checksum is now returned. | 163 # checksum is now returned. |
| 161 # | 164 # |
| 162 purge_pcache | 165 purge_pcache |
| 163 modify_database $iOld | 166 modify_database $iOld |
| 164 do_test fuzz3-$ii.$iNew.[incr iTest] { | 167 do_test fuzz3-$ii.$iNew.[incr iTest] { |
| 165 db_checksum | 168 db_checksum |
| 166 } $::cksum | 169 } $::cksum |
| 167 } | 170 } |
| 168 | 171 |
| 169 finish_test | 172 finish_test |
| OLD | NEW |