/ Check-in [85dd51a7]
Login

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

Overview
Comment:Some changes to test scripts related to codec enabled versions of sqlite.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 85dd51a75c75b2a123744f646e04538e4e5d89b3
User & Date: dan 2010-06-22 13:46:44
Context
2010-06-22
14:49
When trying to transition from journal_mode MEMORY to WAL, use OFF as an intermediate journal mode. check-in: 4775b8f9 user: drh tags: trunk
13:46
Some changes to test scripts related to codec enabled versions of sqlite. check-in: 85dd51a7 user: dan tags: trunk
11:10
Fix problem with handling of -vfs option in tcl interface. check-in: 8f98e8b5 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  5018   5018         ** bytes 92..95 store the change counter for which the version number
  5019   5019         ** is valid. */
  5020   5020         put32bits(((char*)pPgHdr->pData)+92, change_counter);
  5021   5021         put32bits(((char*)pPgHdr->pData)+96, SQLITE_VERSION_NUMBER);
  5022   5022   
  5023   5023         /* If running in direct mode, write the contents of page 1 to the file. */
  5024   5024         if( DIRECT_MODE ){
  5025         -        const void *zBuf = pPgHdr->pData;
         5025  +        const void *zBuf;
  5026   5026           assert( pPager->dbFileSize>0 );
  5027         -        rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0);
         5027  +        CODEC2(pPager, pPgHdr->pData, 1, 6, rc=SQLITE_NOMEM, zBuf);
         5028  +        if( rc==SQLITE_OK ){
         5029  +          rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0);
         5030  +        }
  5028   5031           if( rc==SQLITE_OK ){
  5029   5032             pPager->changeCountDone = 1;
  5030   5033           }
  5031   5034         }else{
  5032   5035           pPager->changeCountDone = 1;
  5033   5036         }
  5034   5037       }

Changes to test/alter2.test.

    17     17   #
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   # We have to have pragmas in order to do this test
    23     23   ifcapable {!pragma} return
           24  +
           25  +# Do not use a codec for tests in this file, as the database file is
           26  +# manipulated directly using tcl scripts. See proc [set_file_format].
           27  +#
           28  +do_not_use_codec
    24     29   
    25     30   # These tests do not work if there is a codec. 
    26     31   #
    27     32   #if {[catch {sqlite3 -has_codec} r] || $r} return
           33  +#
    28     34   
    29     35   # The file format change affects the way row-records stored in tables (but 
    30     36   # not indices) are interpreted. Before version 3.1.3, a row-record for a 
    31     37   # table with N columns was guaranteed to contain exactly N fields. As
    32     38   # of version 3.1.3, the record may contain up to N fields. In this case
    33     39   # the M fields that are present are the values for the left-most M 
    34     40   # columns. The (N-M) rightmost columns contain NULL.

Changes to test/analyze2.test.

    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   ifcapable !stat2 {
    21     21     finish_test
    22     22     return
    23     23   }
           24  +
           25  +# Do not use a codec for tests in this file, as the database file is
           26  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           27  +#
           28  +do_not_use_codec
    24     29   
    25     30   #--------------------------------------------------------------------
    26     31   # Test organization:
    27     32   #
    28     33   # analyze2-1.*: Tests to verify that ANALYZE creates and populates the
    29     34   #               sqlite_stat2 table as expected.
    30     35   #

Changes to test/async4.test.

     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12     12   # $Id: async4.test,v 1.4 2009/06/05 17:09:12 drh Exp $
    13     13   
    14     14   set testdir [file dirname $argv0]
    15     15   source $testdir/tester.tcl
           16  +
           17  +# Do not use a codec for tests in this file, as the database file is
           18  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           19  +#
           20  +do_not_use_codec
    16     21   
    17     22   # These tests only work for Tcl version 8.5 and later on Windows (for now)
    18     23   #
    19     24   if {$tcl_platform(platform)=="windows"} {
    20     25     scan $::tcl_version %f vx
    21     26     if {$vx<8.5} {
    22     27       finish_test

Changes to test/backup.test.

    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing the sqlite3_backup_XXX API.
    13     13   #
    14     14   # $Id: backup.test,v 1.11 2009/06/05 17:09:12 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
           18  +
           19  +do_not_use_codec
    18     20   
    19     21   #---------------------------------------------------------------------
    20     22   # Test organization:
    21     23   #
    22     24   # backup-1.*: Warm-body tests.
    23     25   #
    24     26   # backup-2.*: Test backup under various conditions. To and from in-memory

Changes to test/bigfile.test.

    13     13   # files larger than 4GB.
    14     14   #
    15     15   # $Id: bigfile.test,v 1.12 2009/03/05 04:27:08 shane Exp $
    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
           20  +
           21  +# Do not use a codec for this file, as the database is manipulated using
           22  +# external methods (the [fake_big_file] and [hexio_write] commands).
           23  +#
           24  +do_not_use_codec
    20     25   
    21     26   # If SQLITE_DISABLE_LFS is defined, omit this file.
    22     27   ifcapable !lfs {
    23     28     finish_test
    24     29     return
    25     30   }
    26     31   

Changes to test/capi3.test.

    12     12   # focus of this script testing the callback-free C/C++ API.
    13     13   #
    14     14   # $Id: capi3.test,v 1.70 2009/01/09 02:49:32 drh Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +# Do not use a codec for tests in this file, as the database file is
           21  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           22  +#
           23  +do_not_use_codec
    19     24   
    20     25   # Return the UTF-16 representation of the supplied UTF-8 string $str.
    21     26   # If $nt is true, append two 0x00 bytes as a nul terminator.
    22     27   proc utf16 {str {nt 1}} {
    23     28     set r [encoding convertto unicode $str]
    24     29     if {$nt} {
    25     30       append r "\x00\x00"
................................................................................
   631    636   
   632    637   set ::ENC [execsql {pragma encoding}]
   633    638   db close
   634    639   
   635    640   do_test capi3-6.0 {
   636    641     sqlite3 db test.db
   637    642     set DB [sqlite3_connection_pointer db]
   638         -  sqlite3_key $DB xyzzy
          643  +  if {[sqlite3 -has-codec]==0} { sqlite3_key $DB xyzzy }
   639    644     set sql {SELECT a FROM t1 order by rowid}
   640    645     set STMT [sqlite3_prepare $DB $sql -1 TAIL]
   641    646     expr 0
   642    647   } {0}
   643    648   do_test capi3-6.1 {
   644    649     db cache flush
   645    650     sqlite3_close $DB

Changes to test/capi3c.test.

    14     14   # test the new sqlite3_prepare_v2 interface.
    15     15   #
    16     16   # $Id: capi3c.test,v 1.23 2009/07/22 07:27:57 danielk1977 Exp $
    17     17   #
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
           21  +
           22  +# Do not use a codec for tests in this file, as the database file is
           23  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           24  +#
           25  +do_not_use_codec
    21     26   
    22     27   # Return the UTF-16 representation of the supplied UTF-8 string $str.
    23     28   # If $nt is true, append two 0x00 bytes as a nul terminator.
    24     29   proc utf16 {str {nt 1}} {
    25     30     set r [encoding convertto unicode $str]
    26     31     if {$nt} {
    27     32       append r "\x00\x00"
................................................................................
   602    607   
   603    608   set ::ENC [execsql {pragma encoding}]
   604    609   db close
   605    610   
   606    611   do_test capi3c-6.0 {
   607    612     sqlite3 db test.db
   608    613     set DB [sqlite3_connection_pointer db]
   609         -  sqlite3_key $DB xyzzy
          614  +  if {[sqlite3 -has-codec]==0} { sqlite3_key $DB xyzzy }
   610    615     set sql {SELECT a FROM t1 order by rowid}
   611    616     set STMT [sqlite3_prepare_v2 $DB $sql -1 TAIL]
   612    617     expr 0
   613    618   } {0}
   614    619   do_test capi3c-6.1 {
   615    620     db cache flush
   616    621     sqlite3_close $DB

Changes to test/corrupt.test.

    15     15   #
    16     16   # $Id: corrupt.test,v 1.12 2009/07/13 09:41:45 danielk1977 Exp $
    17     17   
    18     18   catch {file delete -force test.db test.db-journal test.bu}
    19     19   
    20     20   set testdir [file dirname $argv0]
    21     21   source $testdir/tester.tcl
           22  +
           23  +# Do not use a codec for tests in this file, as the database file is
           24  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           25  +#
           26  +do_not_use_codec
    22     27   
    23     28   # Construct a large database for testing.
    24     29   #
    25     30   do_test corrupt-1.1 {
    26     31     execsql {
    27     32       BEGIN;
    28     33       CREATE TABLE t1(x);

Changes to test/corrupt2.test.

    13     13   # This file implements tests to make sure SQLite does not crash or
    14     14   # segfault if it sees a corrupt database file.
    15     15   #
    16     16   # $Id: corrupt2.test,v 1.20 2009/04/06 17:50:03 danielk1977 Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
           20  +
           21  +# Do not use a codec for tests in this file, as the database file is
           22  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           23  +#
           24  +do_not_use_codec
    20     25   
    21     26   # The following tests - corrupt2-1.* - create some databases corrupted in
    22     27   # specific ways and ensure that SQLite detects them as corrupt.
    23     28   #
    24     29   do_test corrupt2-1.1 {
    25     30     execsql {
    26     31       PRAGMA auto_vacuum=0;

Changes to test/corrupt3.test.

    13     13   # This file implements tests to make sure SQLite does not crash or
    14     14   # segfault if it sees a corrupt database file.
    15     15   #
    16     16   # $Id: corrupt3.test,v 1.2 2007/04/06 21:42:22 drh Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
           20  +
           21  +if {[sqlite3 -has-codec]} { finish_test ; return }
    20     22   
    21     23   # We must have the page_size pragma for these tests to work.
    22     24   #
    23     25   ifcapable !pager_pragmas {
    24     26     finish_test
    25     27     return
    26     28   }

Changes to test/corrupt4.test.

    13     13   # This file implements tests to make sure SQLite does not crash or
    14     14   # segfault if it sees a corrupt database file.
    15     15   #
    16     16   # $Id: corrupt4.test,v 1.1 2007/09/07 14:32:07 drh Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
           20  +
           21  +# Do not use a codec for tests in this file, as the database file is
           22  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           23  +#
           24  +do_not_use_codec
    20     25   
    21     26   # We must have the page_size pragma for these tests to work.
    22     27   #
    23     28   ifcapable !pager_pragmas {
    24     29     finish_test
    25     30     return
    26     31   }

Changes to test/corrupt6.test.

    14     14   # segfault if it sees a corrupt database file.  It specifically focuses
    15     15   # on corrupt SerialTypeLen values.
    16     16   #
    17     17   # $Id: corrupt6.test,v 1.2 2008/05/19 15:37:10 shane Exp $
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
           21  +
           22  +# Do not use a codec for tests in this file, as the database file is
           23  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           24  +#
           25  +do_not_use_codec
    21     26   
    22     27   # We must have the page_size pragma for these tests to work.
    23     28   #
    24     29   ifcapable !pager_pragmas {
    25     30     finish_test
    26     31     return
    27     32   }

Changes to test/corrupt7.test.

    14     14   # segfault if it sees a corrupt database file.  It specifically focuses
    15     15   # on corrupt cell offsets in a btree page.
    16     16   #
    17     17   # $Id: corrupt7.test,v 1.8 2009/08/10 10:18:08 danielk1977 Exp $
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
           21  +
           22  +# Do not use a codec for tests in this file, as the database file is
           23  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           24  +#
           25  +do_not_use_codec
    21     26   
    22     27   # We must have the page_size pragma for these tests to work.
    23     28   #
    24     29   ifcapable !pager_pragmas {
    25     30     finish_test
    26     31     return
    27     32   }

Changes to test/corrupt8.test.

    14     14   # segfault if it sees a corrupt database file.  It specifically focuses
    15     15   # on corrupt pointer map pages.
    16     16   #
    17     17   # $Id: corrupt8.test,v 1.2 2008/07/11 03:34:10 drh Exp $
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
           21  +
           22  +# Do not use a codec for tests in this file, as the database file is
           23  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           24  +#
           25  +do_not_use_codec
    21     26   
    22     27   # We must have the page_size pragma for these tests to work.
    23     28   #
    24     29   ifcapable !pager_pragmas||!autovacuum {
    25     30     finish_test
    26     31     return
    27     32   }

Changes to test/corrupt9.test.

    14     14   # segfault if it sees a corrupt database file.  It specifically focuses
    15     15   # on corruption in the form of duplicate entries on the freelist.
    16     16   #
    17     17   # $Id: corrupt9.test,v 1.3 2009/06/04 02:47:04 shane Exp $
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
           21  +
           22  +# Do not use a codec for tests in this file, as the database file is
           23  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           24  +#
           25  +do_not_use_codec
    21     26   
    22     27   # We must have the page_size pragma for these tests to work.
    23     28   #
    24     29   ifcapable !pager_pragmas {
    25     30     finish_test
    26     31     return
    27     32   }

Changes to test/corruptB.test.

    20     20   # contains a (corrupt) reference to a page greater than the configured
    21     21   # maximum page number.
    22     22   #
    23     23   # $Id: corruptB.test,v 1.4 2009/07/21 19:25:24 danielk1977 Exp $
    24     24   
    25     25   set testdir [file dirname $argv0]
    26     26   source $testdir/tester.tcl
           27  +
           28  +# Do not use a codec for tests in this file, as the database file is
           29  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           30  +#
           31  +do_not_use_codec
    27     32   
    28     33   
    29     34   do_test corruptB-1.1 {
    30     35     execsql {
    31     36       PRAGMA auto_vacuum = 1;
    32     37       CREATE TABLE t1(x);
    33     38       INSERT INTO t1 VALUES(randomblob(200));

Changes to test/corruptC.test.

    17     17   #
    18     18   # $Id: corruptC.test,v 1.14 2009/07/11 06:55:34 danielk1977 Exp $
    19     19   
    20     20   catch {file delete -force test.db test.db-journal test.bu}
    21     21   
    22     22   set testdir [file dirname $argv0]
    23     23   source $testdir/tester.tcl
           24  +
           25  +# Do not use a codec for tests in this file, as the database file is
           26  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           27  +#
           28  +do_not_use_codec
    24     29   
    25     30   # Construct a compact, dense database for testing.
    26     31   #
    27     32   do_test corruptC-1.1 {
    28     33     execsql {
    29     34       PRAGMA auto_vacuum = 0;
    30     35       PRAGMA legacy_file_format=1;

Changes to test/corruptE.test.

    16     16   #
    17     17   # $Id: corruptE.test,v 1.14 2009/07/11 06:55:34 danielk1977 Exp $
    18     18   
    19     19   catch {file delete -force test.db test.db-journal test.bu}
    20     20   
    21     21   set testdir [file dirname $argv0]
    22     22   source $testdir/tester.tcl
           23  +
           24  +# Do not use a codec for tests in this file, as the database file is
           25  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           26  +#
           27  +do_not_use_codec
    23     28   
    24     29   # Do not run the tests in this file if ENABLE_OVERSIZE_CELL_CHECK is on.
    25     30   #
    26     31   ifcapable oversize_cell_check {
    27     32     finish_test
    28     33     return
    29     34   }

Changes to test/date.test.

    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is testing date and time functions.
    13     13   #
    14     14   # $Id: date.test,v 1.34 2009/04/16 12:58:03 drh Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
           18  +
           19  +# Do not use a codec for tests in this file, as the database file is
           20  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           21  +#
           22  +do_not_use_codec
    18     23   
    19     24   # Skip this whole file if date and time functions are omitted
    20     25   # at compile-time
    21     26   #
    22     27   ifcapable {!datetime} {
    23     28     finish_test
    24     29     return

Changes to test/descidx1.test.

    12     12   # focus of this script is descending indices.
    13     13   #
    14     14   # $Id: descidx1.test,v 1.10 2008/03/19 00:21:31 drh Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +# Do not use a codec for tests in this file, as the database file is
           21  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           22  +#
           23  +do_not_use_codec
    19     24   
    20     25   db eval {PRAGMA legacy_file_format=OFF}
    21     26   
    22     27   # This procedure sets the value of the file-format in file 'test.db'
    23     28   # to $newval. Also, the schema cookie is incremented.
    24     29   # 
    25     30   proc set_file_format {newval} {

Changes to test/descidx2.test.

    12     12   # focus of this script is descending indices.
    13     13   #
    14     14   # $Id: descidx2.test,v 1.5 2008/03/19 00:21:31 drh Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +# Do not use a codec for tests in this file, as the database file is
           21  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           22  +#
           23  +do_not_use_codec
           24  +
    19     25   
    20     26   db eval {PRAGMA legacy_file_format=OFF}
    21     27   
    22     28   # This procedure sets the value of the file-format in file 'test.db'
    23     29   # to $newval. Also, the schema cookie is incremented.
    24     30   # 
    25     31   proc set_file_format {newval} {

Changes to test/descidx3.test.

    12     12   # focus of this script is descending indices.
    13     13   #
    14     14   # $Id: descidx3.test,v 1.6 2008/03/19 00:21:31 drh Exp $
    15     15   #
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +# Do not use a codec for tests in this file, as the database file is
           21  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           22  +#
           23  +do_not_use_codec
    19     24   
    20     25   ifcapable !bloblit {
    21     26     finish_test
    22     27     return
    23     28   }
    24     29   db eval {PRAGMA legacy_file_format=OFF}
    25     30   

Changes to test/filefmt.test.

    12     12   #
    13     13   # This file implements tests to verify database file format.
    14     14   #
    15     15   # $Id: filefmt.test,v 1.3 2009/06/18 11:34:43 drh Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +# Do not use a codec for tests in this file, as the database file is
           21  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           22  +#
           23  +do_not_use_codec
           24  +
    19     25   db close
    20     26   file delete -force test.db test.db-journal
    21     27   
    22     28   # Database begins with valid 16-byte header string.
    23     29   #
    24     30   do_test filefmt-1.1 {
    25     31     sqlite3 db test.db

Changes to test/lock4.test.

    12     12   # focus of this script is database locks.
    13     13   #
    14     14   # $Id: lock4.test,v 1.10 2009/05/06 00:52:41 drh Exp $
    15     15   
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +do_not_use_codec
    19     21   
    20     22   # Initialize the test.db database so that it is non-empty
    21     23   #
    22     24   do_test lock4-1.1 {
    23     25     db eval {
    24     26        PRAGMA auto_vacuum=OFF;
    25     27        CREATE TABLE t1(x);

Changes to test/lock_common.tcl.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # This file contains code used by several different test scripts. The
    12     12   # code in this file allows testfixture to control another process (or
    13     13   # processes) to test locking.
    14     14   #
           15  +
           16  +do_not_use_codec
    15     17   
    16     18   proc do_multiclient_test {varname script} {
    17     19   
    18     20     foreach code [list {
    19     21       set ::code2_chan [launch_testfixture]
    20     22       set ::code3_chan [launch_testfixture]
    21     23       proc code2 {tcl} { testfixture $::code2_chan $tcl }

Changes to test/minmax3.test.

     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   # $Id: minmax3.test,v 1.5 2008/07/12 14:52:20 drh Exp $
    12     12   
    13     13   set testdir [file dirname $argv0]
    14     14   source $testdir/tester.tcl
           15  +
           16  +# Do not use a codec for tests in this file, as the database file is
           17  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           18  +#
           19  +do_not_use_codec
    15     20   
    16     21   # Do an SQL statement.  Append the search count to the end of the result.
    17     22   #
    18     23   proc count sql {
    19     24     set ::sqlite_search_count 0
    20     25     return [concat [execsql $sql] $::sqlite_search_count]
    21     26   }

Changes to test/nan.test.

    19     19   # out of range.
    20     20   #
    21     21   # $Id: nan.test,v 1.5 2008/09/18 11:30:13 danielk1977 Exp $
    22     22   #
    23     23   
    24     24   set testdir [file dirname $argv0]
    25     25   source $testdir/tester.tcl
           26  +
           27  +# Do not use a codec for tests in this file, as the database file is
           28  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           29  +#
           30  +do_not_use_codec
    26     31   
    27     32   do_test nan-1.1.1 {
    28     33     db eval {
    29     34       PRAGMA auto_vacuum=OFF;
    30     35       PRAGMA page_size=1024;
    31     36       CREATE TABLE t1(x FLOAT);
    32     37     }

Changes to test/pager1.test.

    11     11   #
    12     12   
    13     13   set testdir [file dirname $argv0]
    14     14   source $testdir/tester.tcl
    15     15   source $testdir/lock_common.tcl
    16     16   source $testdir/malloc_common.tcl
    17     17   source $testdir/wal_common.tcl
           18  + 
           19  +# Do not use a codec for tests in this file, as the database file is
           20  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           21  +#
           22  +do_not_use_codec
    18     23   
    19     24   #
    20     25   # pager1-1.*: Test inter-process locking (clients in multiple processes).
    21     26   #
    22     27   # pager1-2.*: Test intra-process locking (multiple clients in this process).
    23     28   #
    24     29   # pager1-3.*: Savepoint related tests.

Changes to test/pcache.test.

    12     12   # This file is focused on testing the pcache module.
    13     13   #
    14     14   # $Id: pcache.test,v 1.5 2009/05/08 06:52:48 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
           19  +# Do not use a codec for tests in this file, as the database file is
           20  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           21  +#
           22  +do_not_use_codec
    19     23   
    20     24   # The pcache module limits the number of pages available to purgeable
    21     25   # caches to the sum of the 'cache_size' values for the set of open
    22     26   # caches. This block of tests, pcache-1.*, test that the library behaves
    23     27   # corrctly when it is forced to exceed this limit.
    24     28   #
    25     29   do_test pcache-1.1 {

Changes to test/permutations.test.

   123    123   lappend ::testsuitelist xxx
   124    124   
   125    125   test_suite "veryquick" -prefix "" -description {
   126    126     "Very" quick test suite. Runs in less than 5 minutes on a workstation. 
   127    127     This test suite is the same as the "quick" tests, except that some files
   128    128     that test malloc and IO errors are omitted.
   129    129   } -files [
   130         -  test_set $allquicktests -exclude *malloc* *ioerr* *fault*
          130  +  test_set $allquicktests -exclude *malloc* *ioerr* *fault* 
   131    131   ]
   132    132   
   133    133   test_suite "quick" -prefix "" -description {
   134    134     Quick test suite. Runs in around 10 minutes on a workstation.
   135    135   } -files [
   136    136     test_set $allquicktests
   137    137   ]

Changes to test/pragma.test.

    12     12   #
    13     13   # This file implements tests for the PRAGMA command.
    14     14   #
    15     15   # $Id: pragma.test,v 1.73 2009/01/12 14:01:45 danielk1977 Exp $
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
           19  +
           20  +# Do not use a codec for tests in this file, as the database file is
           21  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           22  +#
           23  +do_not_use_codec
    19     24   
    20     25   # Test organization:
    21     26   #
    22     27   # pragma-1.*: Test cache_size, default_cache_size and synchronous on main db.
    23     28   # pragma-2.*: Test synchronous on attached db.
    24     29   # pragma-3.*: Test detection of table/index inconsistency by integrity_check.
    25     30   # pragma-4.*: Test cache_size and default_cache_size on attached db.

Changes to test/rdonly.test.

    14     14   # as readonly if its write version is set to  high.
    15     15   #
    16     16   # $Id: rdonly.test,v 1.2 2008/07/08 10:19:58 danielk1977 Exp $
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
           21  +# Do not use a codec for tests in this file, as the database file is
           22  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           23  +#
           24  +do_not_use_codec
    21     25   
    22     26   # Create a database.
    23     27   #
    24     28   do_test rdonly-1.1 {
    25     29     execsql {
    26     30       CREATE TABLE t1(x);
    27     31       INSERT INTO t1 VALUES(1);

Changes to test/tester.tcl.

    90     90   # becomes
    91     91   #
    92     92   #     sqlite3 db test.db -key {xyzzy}
    93     93   #
    94     94   if {[info command sqlite_orig]==""} {
    95     95     rename sqlite3 sqlite_orig
    96     96     proc sqlite3 {args} {
    97         -    if {[llength $args]==2 && [string index [lindex $args 0] 0]!="-"} {
           97  +    if {[llength $args]>=2 && [string index [lindex $args 0] 0]!="-"} {
    98     98         # This command is opening a new database connection.
    99     99         #
   100    100         if {[info exists ::G(perm:sqlite3_args)]} {
   101    101           set args [concat $args $::G(perm:sqlite3_args)]
   102    102         }
   103         -      if {[sqlite_orig -has-codec]} {
          103  +      if {[sqlite_orig -has-codec] && ![info exists ::do_not_use_codec]} {
   104    104           lappend args -key {xyzzy}
   105    105         }
   106    106   
   107    107         set res [uplevel 1 sqlite_orig $args]
   108    108   
   109    109         if {[info exists ::G(perm:presql)]} {
   110    110           [lindex $args 0] eval $::G(perm:presql)
................................................................................
   115    115         # This command is not opening a new database connection. Pass the 
   116    116         # arguments through to the C implemenation as the are.
   117    117         #
   118    118         uplevel 1 sqlite_orig $args
   119    119       }
   120    120     }
   121    121   }
          122  +
          123  +# This command should be called after loading tester.tcl from within
          124  +# all test scripts that are incompatible with encryption codecs.
          125  +#
          126  +proc do_not_use_codec {} {
          127  +  set ::do_not_use_codec 1
          128  +  reset_db
          129  +}
   122    130   
   123    131   # The following block only runs the first time this file is sourced. It
   124    132   # does not run in slave interpreters (since the ::cmdlinearg array is
   125    133   # populated before the test script is run in slave interpreters).
   126    134   #
   127    135   if {[info exists cmdlinearg]==0} {
   128    136   

Changes to test/tkt-9d68c883.test.

    11     11   # This file tests that bug  9d68c883132c8e9ffcd5b0c148c990807b5df1b7
    12     12   # is fixed.
    13     13   #
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
    17     17   
    18         -do_test tkt-XYZ-1.1 {
           18  +do_test tkt-9d68c88-1.1 {
    19     19     execsql {
    20     20       PRAGMA page_size = 1024;
    21     21       PRAGMA auto_vacuum = 2;
    22     22       CREATE TABLE t3(x);
    23     23       CREATE TABLE t4(x);
    24     24       CREATE TABLE t5(x);
    25     25       INSERT INTO t5 VALUES(randomblob(1500));
................................................................................
    30     30   
    31     31   
    32     32   for {set i 0} {$i < 100} {incr i} {
    33     33     db close
    34     34     sqlite3_simulate_device -sectorsize 8192
    35     35     sqlite3 db test.db -vfs devsym
    36     36   
    37         -  do_test tkt-XYZ-2.$i {
           37  +  do_test tkt-9d68c88-2.$i {
    38     38       execsql {
    39     39         BEGIN;
    40     40           DELETE FROM t5;
    41     41           INSERT INTO t8 VALUES('hello world');
    42     42       }
    43     43     
    44     44       sqlite3_memdebug_fail $i -repeat 0

Changes to test/wal.test.

    13     13   # "PRAGMA journal_mode=WAL" mode.
    14     14   #
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   source $testdir/lock_common.tcl
    19     19   source $testdir/malloc_common.tcl
           20  +
           21  +# Do not use a codec for tests in this file, as the database file is
           22  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           23  +#
           24  +do_not_use_codec
    20     25   
    21     26   ifcapable !wal {finish_test ; return }
    22     27   
    23     28   proc reopen_db {} {
    24     29     catch { db close }
    25     30     file delete -force test.db test.db-wal test.db-wal-summary
    26     31     sqlite3_wal db test.db

Changes to test/wal2.test.

    13     13   # "PRAGMA journal_mode=WAL" mode.
    14     14   #
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   source $testdir/lock_common.tcl
    19     19   ifcapable !wal {finish_test ; return }
           20  +
           21  +# Do not use a codec for tests in this file, as the database file is
           22  +# manipulated directly using tcl scripts (using the [hexio_write] command).
           23  +#
           24  +do_not_use_codec
    20     25   
    21     26   proc set_tvfs_hdr {file args} {
    22     27   
    23     28     # Set $nHdr to the number of bytes in the wal-index header:
    24     29     set nHdr 40
    25     30     set nInt [expr {$nHdr/4}]
    26     31