1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix a couple of test cases to account for the master-journal name related change in [cf3bccc2].

FossilOrigin-Name: 21b76af6edd48f665cdd3af5f99d477f030c7668
This commit is contained in:
dan
2011-12-19 11:16:39 +00:00
parent fe6163d7cf
commit 7f9026dd94
3 changed files with 31 additions and 12 deletions

View File

@ -990,8 +990,19 @@ do_test pager1-5.4.1 {
INSERT INTO t2 VALUES(85, 'Gorbachev');
COMMIT;
}
set ::max_journal
} [expr 2615+[string length [pwd]]]
# The size of the journal file is now:
#
# 1) 512 byte header +
# 2) 2 * (1024+8) byte records +
# 3) 20+N bytes of master-journal pointer, where N is the size of
# the master-journal name encoded as utf-8 with no nul term.
#
set mj_pointer [expr {
20 + [string length [pwd]] + [string length "/test.db-mjXXXXXX9XX"]
}]
expr {$::max_journal==(512+2*(1024+8)+$mj_pointer)}
} 1
do_test pager1-5.4.2 {
set ::max_journal 0
execsql {
@ -1001,8 +1012,16 @@ do_test pager1-5.4.2 {
DELETE FROM t2 WHERE b = 'Lenin';
COMMIT;
}
set ::max_journal
} [expr 3111+[string length [pwd]]]
# In synchronous=full mode, the master-journal pointer is not written
# directly after the last record in the journal file. Instead, it is
# written starting at the next (in this case 512 byte) sector boundary.
#
set mj_pointer [expr {
20 + [string length [pwd]] + [string length "/test.db-mjXXXXXX9XX"]
}]
expr {$::max_journal==(((512+2*(1024+8)+511)/512)*512 + $mj_pointer)}
} 1
db close
tv delete