aboutsummaryrefslogtreecommitdiff
path: root/test/incrblob.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/incrblob.test')
-rw-r--r--test/incrblob.test23
1 files changed, 14 insertions, 9 deletions
diff --git a/test/incrblob.test b/test/incrblob.test
index 4277e5c4c..c56689ee1 100644
--- a/test/incrblob.test
+++ b/test/incrblob.test
@@ -126,6 +126,11 @@ foreach AutoVacuumMode [list 0 1] {
execsql "PRAGMA mmap_size = 0"
execsql "PRAGMA auto_vacuum = $AutoVacuumMode"
+ # Extra value added to size answers
+ set ib2_extra 0
+ if {$AutoVacuumMode} {incr ib2_extra}
+ if {[nonzero_reserved_bytes]} {incr ib2_extra}
+
do_test incrblob-2.$AutoVacuumMode.1 {
set ::str [string repeat abcdefghij 2900]
execsql {
@@ -136,7 +141,7 @@ foreach AutoVacuumMode [list 0 1] {
COMMIT;
}
expr [file size test.db]/1024
- } [expr 31 + $AutoVacuumMode]
+ } [expr 31 + $ib2_extra]
ifcapable autovacuum {
do_test incrblob-2.$AutoVacuumMode.2 {
@@ -163,7 +168,7 @@ foreach AutoVacuumMode [list 0 1] {
# sqlite uses the ptrmap pages to avoid reading the other pages.
#
nRead db
- } [expr $AutoVacuumMode ? 4 : 30]
+ } [expr $AutoVacuumMode ? 4 : 30+$ib2_extra]
do_test incrblob-2.$AutoVacuumMode.4 {
string range [db one {SELECT v FROM blobs}] end-19 end
@@ -187,7 +192,7 @@ foreach AutoVacuumMode [list 0 1] {
# sqlite uses the ptrmap pages to avoid reading the other pages.
#
nRead db
- } [expr $AutoVacuumMode ? 4 : 30]
+ } [expr $AutoVacuumMode ? 4 : 30 + $ib2_extra]
# Pages 1 (the write-counter) and 32 (the blob data) were written.
do_test incrblob-2.$AutoVacuumMode.6 {
@@ -210,7 +215,7 @@ foreach AutoVacuumMode [list 0 1] {
do_test incrblob-2.$AutoVacuumMode.9 {
nRead db
- } [expr $AutoVacuumMode ? 4 : 30]
+ } [expr $AutoVacuumMode ? 4 : 30 + $ib2_extra]
}
sqlite3_soft_heap_limit $cmdlinearg(soft-heap-limit)
@@ -384,7 +389,7 @@ ifcapable vtab {
ifcapable attach {
do_test incrblob-5.1 {
forcedelete test2.db test2.db-journal
- set ::size [expr [file size [info script]]]
+ set ::size [expr [file size $::cmdlinearg(INFO_SCRIPT)]]
execsql {
ATTACH 'test2.db' AS aux;
CREATE TABLE aux.files(name, text);
@@ -392,16 +397,16 @@ ifcapable attach {
}
set fd [db incrblob aux files text 1]
fconfigure $fd -translation binary
- set fd2 [open [info script]]
+ set fd2 [open $::cmdlinearg(INFO_SCRIPT)]
fconfigure $fd2 -translation binary
puts -nonewline $fd [read $fd2]
close $fd
close $fd2
set ::text [db one {select text from aux.files}]
string length $::text
- } [file size [info script]]
+ } [file size $::cmdlinearg(INFO_SCRIPT)]
do_test incrblob-5.2 {
- set fd2 [open [info script]]
+ set fd2 [open $::cmdlinearg(INFO_SCRIPT)]
fconfigure $fd2 -translation binary
set ::data [read $fd2]
close $fd2
@@ -576,7 +581,7 @@ foreach {tn arg} {1 "" 2 -readonly} {
}
-set fd [open [info script]]
+set fd [open $::cmdlinearg(INFO_SCRIPT)]
fconfigure $fd -translation binary
set ::data [read $fd 14000]
close $fd