/ Check-in [40fe9088]
Login

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

Overview
Comment:Fix a bug in the wal.test script so that it works on big-endian systems.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:40fe9088fb73eee7b37b574a1dda422266a58638
User & Date: drh 2012-05-11 20:43:47
Context
2012-05-11
23:01
Fix the wal2.test script so that it works on big-endian machines. check-in: c4ab72f7 user: drh tags: trunk
20:43
Fix a bug in the wal.test script so that it works on big-endian systems. check-in: 40fe9088 user: drh tags: trunk
15:53
Fix a harmless compiler warning inside an assert() statement within test code. check-in: e68a3527 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/wal.test.

1219
1220
1221
1222
1223
1224
1225
1226
1227


1228
1229
1230
1231
1232
1233
1234
1235
1236
  set blob
}

proc logcksum {ckv1 ckv2 blob} {
  upvar $ckv1 c1
  upvar $ckv2 c2

  set scanpattern I*
  if {$::tcl_platform(byteOrder) eq "littleEndian"} {


    set scanpattern i*
  }

  binary scan $blob $scanpattern values
  foreach {v1 v2} $values {
    set c1 [expr {($c1 + $v1 + $c2)&0xFFFFFFFF}]
    set c2 [expr {($c2 + $v2 + $c1)&0xFFFFFFFF}]
  }
}







|
|
>
>
|
<







1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230

1231
1232
1233
1234
1235
1236
1237
  set blob
}

proc logcksum {ckv1 ckv2 blob} {
  upvar $ckv1 c1
  upvar $ckv2 c2

  # Since the magic number at the start of the -wal file header is
  # 931071618 that indicates that the content should always be read as
  # little-endian.
  # 
  set scanpattern i*


  binary scan $blob $scanpattern values
  foreach {v1 v2} $values {
    set c1 [expr {($c1 + $v1 + $c2)&0xFFFFFFFF}]
    set c2 [expr {($c2 + $v2 + $c1)&0xFFFFFFFF}]
  }
}