/ Check-in [04813307]
Login

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

Overview
Comment:Updates to test procedures so that they all work with encryption. No changes to the core SQLite code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.21
Files: files | file ages | folders
SHA3-256: 0481330756e861de8e1eb7136e7dca2f333b2a82377949d2e0eba401af7d73dd
User & Date: drh 2017-10-23 16:34:07
Context
2017-10-23
20:20
Merge trunk fixes to swarmvtabfault.test and the lsm extension into this branch. No changes to core SQLite code. check-in: f632b870 user: dan tags: branch-3.21
16:34
Updates to test procedures so that they all work with encryption. No changes to the core SQLite code. check-in: 04813307 user: drh tags: branch-3.21
16:03
Avoid passing a NULL value as the second argument to memcpy(). check-in: 58e5bb49 user: dan tags: branch-3.21
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_config.c.

   209    209   #endif
   210    210   
   211    211   #ifdef SQLITE_ENABLE_JSON1
   212    212     Tcl_SetVar2(interp, "sqlite_options", "json1", "1", TCL_GLOBAL_ONLY);
   213    213   #else
   214    214     Tcl_SetVar2(interp, "sqlite_options", "json1", "0", TCL_GLOBAL_ONLY);
   215    215   #endif
          216  +
          217  +#ifdef SQLITE_HAS_CODEC
          218  +  Tcl_SetVar2(interp, "sqlite_options", "has_codec", "1", TCL_GLOBAL_ONLY);
          219  +#else
          220  +  Tcl_SetVar2(interp, "sqlite_options", "has_codec", "0", TCL_GLOBAL_ONLY);
          221  +#endif
   216    222   
   217    223   #ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS
   218    224     Tcl_SetVar2(interp, "sqlite_options", "like_match_blobs", "0", TCL_GLOBAL_ONLY);
   219    225   #else
   220    226     Tcl_SetVar2(interp, "sqlite_options", "like_match_blobs", "1", TCL_GLOBAL_ONLY);
   221    227   #endif
   222    228   

Changes to test/pragma.test.

  1930   1930     }
  1931   1931     db2 eval {
  1932   1932       PRAGMA foreign_key_list(t2);
  1933   1933     }
  1934   1934   } {0 0 t1 y {} {NO ACTION} {NO ACTION} NONE}
  1935   1935   db2 close
  1936   1936   
  1937         -reset_db
  1938         -do_execsql_test 24.0 {
  1939         -  PRAGMA page_size = 1024;
  1940         -  CREATE TABLE t1(a, b, c);
  1941         -  CREATE INDEX i1 ON t1(b);
  1942         -  INSERT INTO t1 VALUES('a', 'b', 'c');
  1943         -  PRAGMA integrity_check;
  1944         -} {ok}
  1945         -
  1946         -set r [db one {SELECT rootpage FROM sqlite_master WHERE name = 't1'}]
  1947         -db close
  1948         -hexio_write test.db [expr $r*1024 - 16] 000000000000000701040f0f1f616263
  1949         -
  1950         -sqlite3 db test.db
  1951         -do_catchsql_test 24.1 {
  1952         -  SELECT * FROM t1;
  1953         -} {1 {database disk image is malformed}}
  1954         -do_catchsql_test 24.2 {
  1955         -  PRAGMA integrity_check;
  1956         -} {0 {{database disk image is malformed}}}
  1957         -
         1937  +ifcapable !has_codec {
         1938  +  reset_db
         1939  +  do_execsql_test 24.0 {
         1940  +    PRAGMA page_size = 1024;
         1941  +    CREATE TABLE t1(a, b, c);
         1942  +    CREATE INDEX i1 ON t1(b);
         1943  +    INSERT INTO t1 VALUES('a', 'b', 'c');
         1944  +    PRAGMA integrity_check;
         1945  +  } {ok}
         1946  +  
         1947  +  set r [db one {SELECT rootpage FROM sqlite_master WHERE name = 't1'}]
         1948  +  db close
         1949  +  hexio_write test.db [expr $r*1024 - 16] 000000000000000701040f0f1f616263
         1950  +  
         1951  +  sqlite3 db test.db
         1952  +  do_catchsql_test 24.1 {
         1953  +    SELECT * FROM t1;
         1954  +  } {1 {database disk image is malformed}}
         1955  +  do_catchsql_test 24.2 {
         1956  +    PRAGMA integrity_check;
         1957  +  } {0 {{database disk image is malformed}}}
         1958  +}  
  1958   1959   database_never_corrupt
  1959   1960   finish_test

Changes to test/schema6.test.

    14     14   # names, white-space, and formatting of the CREATE TABLE statement should
    15     15   # produce identical table content.
    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   set ::testprefix schema6
           21  +do_not_use_codec
    21     22   
    22     23   # Command:   check_same_database_content TESTNAME SQL1 SQL2 SQL3 ...
    23     24   #
    24     25   # This command creates fresh databases using SQL1 and subsequent arguments
    25     26   # and checks to make sure the content of all database files is byte-for-byte
    26     27   # identical.  Page 1 of the database files is allowed to be different, since
    27     28   # page 1 contains the sqlite_master table which is expected to vary.

Changes to test/swarmvtab.test.

    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is the "swarmvtab" extension
    13     13   #
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
    17     17   set testprefix swarmvtab
           18  +do_not_use_codec
    18     19   
    19     20   ifcapable !vtab {
    20     21     finish_test
    21     22     return
    22     23   }
    23     24   
    24     25   load_static_extension db unionvtab
................................................................................
   239    240   } {}
   240    241   
   241    242   do_catchsql_test 3.3.2 { SELECT * FROM xyz } {1 {fetch_db error!}}
   242    243   
   243    244   
   244    245   
   245    246   finish_test
   246         -

Changes to test/swarmvtab2.test.

    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is the "swarmvtab" extension
    13     13   #
    14     14   
    15     15   set testdir [file dirname $argv0]
    16     16   source $testdir/tester.tcl
    17     17   set testprefix swarmvtab
           18  +do_not_use_codec
    18     19   
    19     20   ifcapable !vtab {
    20     21     finish_test
    21     22     return
    22     23   }
    23     24   
    24     25