/ Check-in [04ab2dc6]
Login

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

Overview
Comment:Update a couple of test scripts so that they work in auto-vacuum mode.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:04ab2dc6914e4d6fe2682eba08fc1cd1148a44a1
User & Date: dan 2012-12-05 09:12:58
Context
2012-12-05
10:01
If the atomic-write property is enabled, a transaction may be committed in journal_mode=DELETE mode without ever actually creating a journal file on disk. In this case, do not attempt to unlink() the journal file when committing the transaction. check-in: 11aa47b0 user: dan tags: trunk
09:12
Update a couple of test scripts so that they work in auto-vacuum mode. check-in: 04ab2dc6 user: dan tags: trunk
2012-12-04
11:03
Fix a harmless compiler warning. check-in: 12693deb user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/backup4.test.

    59     59   # Test that if the source is zero bytes, the destination database 
    60     60   # consists of a single page only.
    61     61   #
    62     62   do_execsql_test 2.1 {
    63     63     CREATE TABLE t1(a, b);
    64     64     CREATE INDEX i1 ON t1(a, b);
    65     65   }
    66         -
    67         -do_test 2.2 { file size test.db } 3072
           66  +do_test 2.2 { file size test.db } [expr $AUTOVACUUM ? 4096 : 3072]
    68     67   
    69     68   do_test 2.3 {
    70     69     sqlite3 db1 test.db2
    71     70     db1 backup test.db
    72     71     db1 close
    73     72     file size test.db
    74     73   } {1024}
................................................................................
    86     85   # of a single page.
    87     86   #
    88     87   do_execsql_test 3.1 {
    89     88     PRAGMA page_size = 4096;
    90     89     CREATE TABLE t1(a, b);
    91     90     CREATE INDEX i1 ON t1(a, b);
    92     91   }
    93         -
    94         -do_test 3.2 { file size test.db } 12288
           92  +do_test 3.2 { file size test.db } [expr $AUTOVACUUM ? 16384 : 12288]
    95     93   
    96     94   do_test 3.3 {
    97     95     sqlite3 db1 test.db2
    98     96     db1 backup test.db
    99     97     db1 close
   100     98     file size test.db
   101     99   } {1024}
   102    100   
   103    101   do_test 3.4 { file size test.db2 } 0
   104    102   
   105    103   finish_test
   106    104   

Changes to test/wal9.test.

    56     56       INSERT INTO t SELECT randomblob(100) FROM t;
    57     57       INSERT INTO t SELECT randomblob(100) FROM t;
    58     58     COMMIT;
    59     59   } {}
    60     60   
    61     61   # Check file sizes are as expected. The real requirement here is that 
    62     62   # the *shm file is now more than one chunk (>32KiB).
           63  +#
           64  +# The sizes of various files are slightly different in normal and 
           65  +# auto-vacuum mode.
    63     66   do_test 1.3 { file size test.db     } {1024}
    64         -do_test 1.4 { file size test.db-wal } {15421352}
    65         -do_test 1.5 { expr {[file size test.db-shm]>32768} } {1}
    66         -
    67         -do_execsql_test 1.6 { PRAGMA wal_checkpoint } {0 14715 14715}
           67  +do_test 1.4 { expr {[file size test.db-wal]>(1500*1024)} } {1}
           68  +do_test 1.5 { expr {[file size test.db-shm]>32768} }       {1}
           69  +do_test 1.6 { 
           70  +  foreach {a b c} [db eval {PRAGMA wal_checkpoint}] break
           71  +  list [expr {$a==0}] [expr {$b>14500}] [expr {$c>14500}] [expr {$b==$c}]
           72  +} {1 1 1 1}
    68     73   
    69     74   # At this point connection [db2] has mapped the first 32KB of the *shm file
    70     75   # only. Because the entire WAL file has been checkpointed, it is not 
    71     76   # necessary to map any more of the *-shm file to read or write the database
    72     77   # (since all data will be read directly from the db file). 
    73     78   #
    74     79   # However, at one point if a transaction that had not yet written to the