/ Check-in [a38668dc]
Login

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

Overview
Comment:Fix some test files so that they work with SQLITE_OMIT_WAL builds.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a38668dcff0a4d241d959ea19330ad43295d757d
User & Date: dan 2011-09-24 05:55:36
Context
2011-09-24
09:54
Fix misc3.test so that it works with OMIT_MERGE_SORT builds. check-in: 87946c62 user: dan tags: trunk
05:55
Fix some test files so that they work with SQLITE_OMIT_WAL builds. check-in: a38668dc user: dan tags: trunk
2011-09-23
18:58
Add SQLITE_DBSTATUS_CACHE_HIT and _MISS to the ".stat" command in the shell. check-in: d279e1a3 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/attach4.test.

    71     71     set L
    72     72   } $files
    73     73   
    74     74   set L [list]
    75     75   set S ""
    76     76   foreach {name f} $files {
    77     77     if {[permutation] == "journaltest"} {
    78         -    lappend L delete
           78  +    set mode delete
    79     79     } else {
    80         -    lappend L wal
           80  +    set mode wal
    81     81     }
           82  +  ifcapable !wal { set mode delete }
           83  +  lappend L $mode
    82     84     append S "
    83     85       PRAGMA $name.journal_mode = WAL;
    84     86       UPDATE $name.tbl SET x = '$name';
    85     87     "
    86     88   }
    87     89   do_execsql_test 1.5 $S $L
    88     90   

Changes to test/oserror.test.

    93     93   } {1 {unable to open database file}}
    94     94   
    95     95   do_re_test 1.4.2 { lindex $::log 0 } {^os_unix.c:\d*: \(\d+\) open\(.*test.db\) - }
    96     96   
    97     97   #--------------------------------------------------------------------------
    98     98   # Tests oserror-1.* test failures in the unlink() system call.
    99     99   #
   100         -do_test 2.1.1 {
   101         -  set ::log [list]
   102         -  file mkdir test.db-wal
   103         -  forcedelete test.db
   104         -  list [catch {
   105         -    sqlite3 dbh test.db
   106         -    execsql { SELECT * FROM sqlite_master } dbh
   107         -  } msg] $msg
   108         -} {1 {disk I/O error}}
   109         -
   110         -do_re_test 2.1.2 { 
   111         -  lindex $::log 0 
   112         -} {^os_unix.c:\d+: \(\d+\) unlink\(.*test.db-wal\) - }
   113         -do_test 2.1.3 { 
   114         -  catch { dbh close }
   115         -  forcedelete test.db-wal
   116         -} {}
          100  +ifcapable wal {
          101  +  do_test 2.1.1 {
          102  +    set ::log [list]
          103  +    file mkdir test.db-wal
          104  +    forcedelete test.db
          105  +    list [catch {
          106  +      sqlite3 dbh test.db
          107  +      execsql { SELECT * FROM sqlite_master } dbh
          108  +    } msg] $msg
          109  +  } {1 {disk I/O error}}
          110  +  
          111  +  do_re_test 2.1.2 { 
          112  +    lindex $::log 0 
          113  +  } {^os_unix.c:\d+: \(\d+\) unlink\(.*test.db-wal\) - }
          114  +  do_test 2.1.3 { 
          115  +    catch { dbh close }
          116  +    forcedelete test.db-wal
          117  +  } {}
          118  +}
   117    119     
   118    120   
   119    121   test_syscall reset
   120    122   sqlite3_shutdown
   121    123   test_sqlite3_log 
   122    124   sqlite3_initialize
   123    125   finish_test

Changes to test/pager1.test.

  1988   1988   
  1989   1989   #-------------------------------------------------------------------------
  1990   1990   # Test that a "PRAGMA wal_checkpoint":
  1991   1991   #
  1992   1992   #   pager1-22.1.*: is a no-op on a non-WAL db, and
  1993   1993   #   pager1-22.2.*: does not cause xSync calls with a synchronous=off db.
  1994   1994   #
  1995         -do_test pager1-22.1.1 {
  1996         -  faultsim_delete_and_reopen
  1997         -  execsql {
  1998         -    CREATE TABLE ko(c DEFAULT 'abc', b DEFAULT 'def');
  1999         -    INSERT INTO ko DEFAULT VALUES;
  2000         -  }
  2001         -  execsql { PRAGMA wal_checkpoint }
  2002         -} {0 -1 -1}
  2003         -do_test pager1-22.2.1 {
  2004         -  testvfs tv -default 1
  2005         -  tv filter xSync
  2006         -  tv script xSyncCb
  2007         -  proc xSyncCb {args} {incr ::synccount}
  2008         -  set ::synccount 0
  2009         -  sqlite3 db test.db
  2010         -  execsql {
  2011         -    PRAGMA synchronous = off;
  2012         -    PRAGMA journal_mode = WAL;
  2013         -    INSERT INTO ko DEFAULT VALUES;
  2014         -  }
  2015         -  execsql { PRAGMA wal_checkpoint }
  2016         -  set synccount
  2017         -} {0}
  2018         -db close
  2019         -tv delete
         1995  +ifcapable wal {
         1996  +  do_test pager1-22.1.1 {
         1997  +    faultsim_delete_and_reopen
         1998  +    execsql {
         1999  +      CREATE TABLE ko(c DEFAULT 'abc', b DEFAULT 'def');
         2000  +      INSERT INTO ko DEFAULT VALUES;
         2001  +    }
         2002  +    execsql { PRAGMA wal_checkpoint }
         2003  +  } {0 -1 -1}
         2004  +  do_test pager1-22.2.1 {
         2005  +    testvfs tv -default 1
         2006  +    tv filter xSync
         2007  +    tv script xSyncCb
         2008  +    proc xSyncCb {args} {incr ::synccount}
         2009  +    set ::synccount 0
         2010  +    sqlite3 db test.db
         2011  +    execsql {
         2012  +      PRAGMA synchronous = off;
         2013  +      PRAGMA journal_mode = WAL;
         2014  +      INSERT INTO ko DEFAULT VALUES;
         2015  +    }
         2016  +    execsql { PRAGMA wal_checkpoint }
         2017  +    set synccount
         2018  +  } {0}
         2019  +  db close
         2020  +  tv delete
         2021  +}
  2020   2022   
  2021   2023   #-------------------------------------------------------------------------
  2022   2024   # Tests for changing journal mode.
  2023   2025   #
  2024   2026   #   pager1-23.1.*: Test that when changing from PERSIST to DELETE mode,
  2025   2027   #                  the journal file is deleted.
  2026   2028   #

Changes to test/superlock.test.

    43     43   #
    44     44   
    45     45   do_execsql_test 1.1 {
    46     46     CREATE TABLE t1(a, b);
    47     47     INSERT INTO t1 VALUES(1, 2);
    48     48     PRAGMA journal_mode = DELETE;
    49     49   } {delete}
           50  +
           51  +ifcapable !wal {
           52  +  finish_test
           53  +  return
           54  +}
    50     55   
    51     56   do_test 1.2 { sqlite3demo_superlock unlock test.db } {unlock}
    52     57   do_catchsql_test 1.3 { SELECT * FROM t1 } {1 {database is locked}}
    53     58   do_test 1.4 { unlock } {}
    54     59   
    55     60   do_execsql_test 2.1 { 
    56     61     INSERT INTO t1 VALUES(3, 4);

Changes to test/uri.test.

   215    215   #
   216    216   
   217    217   # This block of code creates two VFS - "tvfs1" and "tvfs2". Each time one
   218    218   # of the above methods is called using "tvfs1", global variable ::T1(X) is
   219    219   # set, where X is the file-name the method is called on. Calls to the above
   220    220   # methods using "tvfs2" set entries in the global T2 array.
   221    221   #
   222         -testvfs tvfs1 
   223         -tvfs1 filter {xOpen xDelete xAccess xFullPathname}
   224         -tvfs1 script tvfs1_callback
   225         -proc tvfs1_callback {method filename args} { 
   226         -  set ::T1([file tail $filename]) 1 
   227         -}
   228         -testvfs tvfs2 
   229         -tvfs2 filter {xOpen xDelete xAccess xFullPathname}
   230         -tvfs2 script tvfs2_callback
   231         -proc tvfs2_callback {method filename args} { 
   232         -  set ::T2([file tail $filename]) 1 
   233         -}
   234         -
   235         -catch {db close}
   236         -eval forcedelete [glob test.db*]
   237         -do_test 5.1.1 {
   238         -  sqlite3 db file:test.db1?vfs=tvfs1
   239         -  execsql {
   240         -    ATTACH 'file:test.db2?vfs=tvfs2' AS aux;
   241         -    PRAGMA main.journal_mode = PERSIST;
   242         -    PRAGMA aux.journal_mode = PERSIST;
   243         -    CREATE TABLE t1(a, b);
   244         -    CREATE TABLE aux.t2(a, b);
   245         -    PRAGMA main.journal_mode = WAL;
   246         -    PRAGMA aux.journal_mode = WAL;
   247         -    INSERT INTO t1 VALUES('x', 'y');
   248         -    INSERT INTO t2 VALUES('x', 'y');
          222  +ifcapable wal {
          223  +  testvfs tvfs1 
          224  +  tvfs1 filter {xOpen xDelete xAccess xFullPathname}
          225  +  tvfs1 script tvfs1_callback
          226  +  proc tvfs1_callback {method filename args} { 
          227  +    set ::T1([file tail $filename]) 1 
          228  +  }
          229  +  testvfs tvfs2 
          230  +  tvfs2 filter {xOpen xDelete xAccess xFullPathname}
          231  +  tvfs2 script tvfs2_callback
          232  +  proc tvfs2_callback {method filename args} { 
          233  +    set ::T2([file tail $filename]) 1 
   249    234     }
   250         -  lsort [array names ::T1]
   251         -} {test.db1 test.db1-journal test.db1-wal}
   252         -
   253         -do_test 5.1.2 {
   254         -  lsort [array names ::T2]
   255         -} {test.db2 test.db2-journal test.db2-wal}
   256         -
   257         -db close
   258         -tvfs1 delete
   259         -tvfs2 delete
          235  +  
          236  +  catch {db close}
          237  +  eval forcedelete [glob test.db*]
          238  +  do_test 5.1.1 {
          239  +    sqlite3 db file:test.db1?vfs=tvfs1
          240  +    execsql {
          241  +      ATTACH 'file:test.db2?vfs=tvfs2' AS aux;
          242  +      PRAGMA main.journal_mode = PERSIST;
          243  +      PRAGMA aux.journal_mode = PERSIST;
          244  +      CREATE TABLE t1(a, b);
          245  +      CREATE TABLE aux.t2(a, b);
          246  +      PRAGMA main.journal_mode = WAL;
          247  +      PRAGMA aux.journal_mode = WAL;
          248  +      INSERT INTO t1 VALUES('x', 'y');
          249  +      INSERT INTO t2 VALUES('x', 'y');
          250  +    }
          251  +    lsort [array names ::T1]
          252  +  } {test.db1 test.db1-journal test.db1-wal}
          253  +  
          254  +  do_test 5.1.2 {
          255  +    lsort [array names ::T2]
          256  +  } {test.db2 test.db2-journal test.db2-wal}
          257  +  db close
          258  +  
          259  +  tvfs1 delete
          260  +  tvfs2 delete
          261  +}
   260    262   
   261    263   #-------------------------------------------------------------------------
   262    264   # Check that only "" and "localhost" are acceptable as authorities.
   263    265   #
   264    266   catch {db close}
   265    267   foreach {tn uri res} {
   266    268     1     "file://localhost/PWD/test.db"   {not an error}

Changes to test/walbig.test.

    12     12   # focus of this script testing the ability of SQLite to handle database
    13     13   # files larger than 4GB in WAL mode.
    14     14   #
    15     15   
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +ifcapable !wal {
           21  +  finish_test
           22  +  return
           23  +}
    19     24   
    20     25   # Do not use a codec for this file, as the database is manipulated using
    21     26   # external methods (the [fake_big_file] and [hexio_write] commands).
    22     27   #
    23     28   do_not_use_codec
    24     29   
    25     30   # If SQLITE_DISABLE_LFS is defined, omit this file.

Changes to test/walpersist.test.

    12     12   # This file contains tests for using WAL with persistent WAL file mode.
    13     13   #
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
    17     17   source $testdir/lock_common.tcl
    18     18   set ::testprefix walpersist
           19  +
           20  +ifcapable !wal {
           21  +  finish_test
           22  +  return
           23  +}
    19     24   
    20     25   do_test walpersist-1.0 {
    21     26     db eval {
    22     27       PRAGMA journal_mode=WAL;
    23     28       CREATE TABLE t1(a);
    24     29       INSERT INTO t1 VALUES(randomblob(5000));
    25     30     }

Changes to test/walro.test.

    19     19   
    20     20   # These tests are only going to work on unix.
    21     21   #
    22     22   if {$::tcl_platform(platform) != "unix"} {
    23     23     finish_test
    24     24     return
    25     25   }
           26  +
           27  +# And only if the build is WAL-capable.
           28  +#
           29  +ifcapable !wal {
           30  +  finish_test
           31  +  return
           32  +}
    26     33   
    27     34   do_multiclient_test tn {
    28     35     # Do not run tests with the connections in the same process.
    29     36     #
    30     37     if {$tn==2} continue
    31     38     
    32     39     # Close all connections and delete the database.