/ Check-in [5fd008f0]
Login

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

Overview
Comment:Disable the snapshot test scripts if not compiled with SQLITE_ENABLE_SNAPSHOT.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | snapshot-get
Files: files | file ages | folders
SHA1: 5fd008f0433833e4341d526dcc2387570ffe1fea
User & Date: drh 2015-12-11 03:20:39
Context
2015-12-11
03:27
Mention that the snapshot interfaces are only available if SQLite is compiled with SQLITE_ENABLE_SNAPSHOT. Closed-Leaf check-in: 843c15a5 user: drh tags: snapshot-get
03:20
Disable the snapshot test scripts if not compiled with SQLITE_ENABLE_SNAPSHOT. check-in: 5fd008f0 user: drh tags: snapshot-get
03:16
Fix a variable type mismatch problem in the snapshot logic. check-in: 93fb8010 user: drh tags: snapshot-get
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/test_config.c.

   138    138   #endif
   139    139   
   140    140   #ifdef SQLITE_ENABLE_MEMSYS5
   141    141     Tcl_SetVar2(interp, "sqlite_options", "mem5", "1", TCL_GLOBAL_ONLY);
   142    142   #else
   143    143     Tcl_SetVar2(interp, "sqlite_options", "mem5", "0", TCL_GLOBAL_ONLY);
   144    144   #endif
          145  +
          146  +#ifdef SQLITE_ENABLE_SNAPSHOT
          147  +  Tcl_SetVar2(interp, "sqlite_options", "snapshot", "1", TCL_GLOBAL_ONLY);
          148  +#else
          149  +  Tcl_SetVar2(interp, "sqlite_options", "snapshot", "0", TCL_GLOBAL_ONLY);
          150  +#endif
   145    151   
   146    152   #ifdef SQLITE_MUTEX_OMIT
   147    153     Tcl_SetVar2(interp, "sqlite_options", "mutex", "0", TCL_GLOBAL_ONLY);
   148    154   #else
   149    155     Tcl_SetVar2(interp, "sqlite_options", "mutex", "1", TCL_GLOBAL_ONLY);
   150    156   #endif
   151    157   

Changes to test/snapshot.test.

    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library. The focus
    12     12   # of this file is the sqlite3_snapshot_xxx() APIs.
    13     13   #
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
           17  +ifcapable !snapshot {finish_test; return}
    17     18   set testprefix snapshot
    18     19   
    19     20   #-------------------------------------------------------------------------
    20     21   # Check some error conditions in snapshot_get(). It is an error if:
    21     22   #
    22     23   #  1) snapshot_get() is called on a non-WAL database, or
    23     24   #  2) there is an open write transaction on the database.
................................................................................
   333    334     db2 eval "PRAGMA user_version ; BEGIN"
   334    335     sqlite3_snapshot_open db2 main $::snapshot
   335    336     db2 eval { SELECT * FROM x1 }
   336    337   } {z zz zzz}
   337    338   sqlite3_snapshot_free $snapshot
   338    339   
   339    340   finish_test
   340         -

Changes to test/snapshot_fault.test.

    10     10   #***********************************************************************
    11     11   # This file implements regression tests for SQLite library. The focus
    12     12   # of this file is the sqlite3_snapshot_xxx() APIs.
    13     13   #
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
           17  +ifcapable !snapshot {finish_test; return}
    17     18   set testprefix snapshot_fault
    18     19   
    19     20   #-------------------------------------------------------------------------
    20     21   # Check that an sqlite3_snapshot_open() client cannot be tricked into
    21     22   # reading a corrupt snapshot even if a second client fails while 
    22     23   # checkpointing the db.
    23     24   #
................................................................................
   157    158   
   158    159     sqlite3_snapshot_free $::snapshot
   159    160   }
   160    161   
   161    162   
   162    163   
   163    164   finish_test
   164         -