diff options
author | dan <dan@noemail.net> | 2010-08-19 17:16:11 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2010-08-19 17:16:11 +0000 |
commit | 9ab7fe87e5e3a58e12c17bc42a3deb7bbb79c6f8 (patch) | |
tree | a055a23ecf920d6e9aa2fdb4fe3b30efc6613ae2 /test/backcompat.test | |
parent | fc5026d3c23d4f3d464e4c83b771fcb6e5c71904 (diff) | |
download | sqlite-9ab7fe87e5e3a58e12c17bc42a3deb7bbb79c6f8.tar.gz sqlite-9ab7fe87e5e3a58e12c17bc42a3deb7bbb79c6f8.zip |
Fix backcompat.test so that it works with windows mandatory locking.
FossilOrigin-Name: 8d05f66db7d6e8b8916fcf22fa92159d863d2610
Diffstat (limited to 'test/backcompat.test')
-rw-r--r-- | test/backcompat.test | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/backcompat.test b/test/backcompat.test index 469aeb6c7..1aa5179ad 100644 --- a/test/backcompat.test +++ b/test/backcompat.test @@ -114,10 +114,19 @@ proc do_allbackcompat_test {script} { proc read_file {zFile} { set zData {} - catch { + if {[file exists $zFile]} { set fd [open $zFile] fconfigure $fd -translation binary -encoding binary - set zData [read $fd] + + if {[file size $zFile]<=$::sqlite_pending_byte || $zFile != "test.db"} { + set zData [read $fd] + } else { + set zData [read $fd $::sqlite_pending_byte] + append zData [string repeat x 512] + seek $fd [expr $::sqlite_pending_byte+512] start + append zData [read $fd] + } + close $fd } return $zData |