/ Check-in [60c22bde]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor changes to checksum related test cases.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 60c22bde52121993d4bea11eef38ab285c737e2c
User & Date: dan 2010-05-29 06:18:55
Original Comment: i i Minor changes to checksum related test cases.
Context
2010-05-29
08:40
Add tests to fkey2.test to check that ON CONFLICT clauses do not affect SQLite's behaviour when an FK constraint is violated. check-in: e9e5b100 user: dan tags: trunk
06:18
Minor changes to checksum related test cases. check-in: 60c22bde user: dan tags: trunk
2010-05-28
11:16
Add a test to walcksum.test to stress the checksum calculation. check-in: 778d0c17 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/wal2.test.

    26     26   
    27     27     if {[llength $args]>1} {
    28     28       return -code error {wrong # args: should be "set_tvfs_hdr fileName ?val?"}
    29     29     }
    30     30   
    31     31     set blob [tvfs shm $file]
    32     32     if {[llength $args]} {
    33         -    set blob [
    34         -      binary format i${nInt}a* [lindex $args 0] [string range $blob $nHdr end]
    35         -    ]
           33  +    set ia [lindex $args 0]
           34  +    set tail [string range $blob [expr $nHdr*2] end]
           35  +    set blob [binary format i${nInt}i${nInt}a* $ia $ia $tail]
    36     36       tvfs shm $file $blob
    37     37     }
    38     38   
    39     39     binary scan $blob i${nInt} ints
    40     40     return $ints
    41     41   }
    42     42   
................................................................................
    97     97            3    6   {6 21}    1             {READ RECOVER READ UNLOCK}
    98     98            4    7   {7 28}    2             {READ RECOVER READ UNLOCK}
    99     99            5    8   {8 36}    3             {READ RECOVER READ UNLOCK}
   100    100            6    9   {9 45}    4             {READ RECOVER READ UNLOCK}
   101    101            7   10   {10 55}   5             {READ RECOVER READ UNLOCK}
   102    102            8   11   {11 66}   6             {READ RECOVER READ UNLOCK}
   103    103            9   12   {12 78}   7             {READ RECOVER READ UNLOCK}
   104         -        10   13   {13 91}   -1            {READ UNLOCK}
          104  +        10   13   {13 91}   8             {READ RECOVER READ UNLOCK}
          105  +        11   14   {14 105}  9             {READ RECOVER READ UNLOCK}
          106  +        12   15   {15 120}  -1            {READ UNLOCK}
   105    107   } {
   106    108   
   107    109     do_test wal2-1.$tn.1 {
   108    110       execsql { INSERT INTO t1 VALUES($iInsert) }
   109    111   
   110    112       set ::locks [list]
   111    113       set ::cb_done 0

Changes to test/walcksum.test.

   356    356     file copy -force test.db-wal test2.db-wal
   357    357     file copy -force test.db test2.db
   358    358     sqlite3 db2 test2.db
   359    359     execsql { SELECT a FROM t1 } db2
   360    360   } {1 2 3}
   361    361   db2 close
   362    362   file copy -force test.db test2.db
   363         -for {set incr 1} {$incr <= 255} {incr incr 21} {
          363  +
          364  +
          365  +foreach incr {1 2 3 20 40 60 80 100 120 140 160 180 200 220 240 253 254 255} {
   364    366     do_test walcksum-3.3.$incr {
   365    367       set FAIL 0
   366    368       for {set iOff 0} {$iOff < [log_file_size 1 1024]} {incr iOff} {
   367    369   
   368    370         file copy -force test.db-wal test2.db-wal
   369    371         set fd [open test2.db-wal r+]
   370    372         fconfigure $fd -encoding binary
   371    373         fconfigure $fd -translation binary
   372    374     
   373    375         seek $fd $iOff
   374    376         binary scan [read $fd 1] c x
   375    377         seek $fd $iOff
   376         -      puts -nonewline $fd [binary format c [expr {$x+$incr}]]
          378  +      puts -nonewline $fd [binary format c [expr {($x+$incr)&0xFF}]]
   377    379         close $fd
   378    380       
   379    381         sqlite3 db2 test2.db
   380    382         if { [execsql { SELECT a FROM t1 } db2] != "1 2" } {set FAIL 1}
   381    383         db2 close
   382    384       }
   383    385       set FAIL
   384    386     } {0}
   385    387   }
   386    388     
   387    389   finish_test
   388    390