/ Check-in [c333ee7e]
Login

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

Overview
Comment:Fix minor test script problems revealed by releasetest.tcl.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.21
Files: files | file ages | folders
SHA3-256:c333ee7e9677bda1dad8e80cf94755350bfe20bc0754577442727b6f807ad831
User & Date: dan 2017-10-23 07:53:00
Context
2017-10-23
16:03
Avoid passing a NULL value as the second argument to memcpy(). check-in: 58e5bb49 user: dan tags: branch-3.21
07:53
Fix minor test script problems revealed by releasetest.tcl. check-in: c333ee7e user: dan tags: branch-3.21
07:52
Fix minor test script problems revealed by releasetest.tcl. check-in: 15e87d9b user: dan tags: trunk
2017-10-22
08:03
Fix test cases in dbpage.test so that they work with SQLITE_DEFAULT_AUTOVACUUM=1 builds. check-in: 9474f061 user: dan tags: branch-3.21
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/corruptK.test.

106
107
108
109
110
111
112

113
114
115
116
117
118
119
...
215
216
217
218
219
220
221

222
223
224
225
226
do_catchsql_test 2.3 {
  INSERT INTO t1 VALUES(randomblob(900));
} {1 {database disk image is malformed}}

#-------------------------------------------------------------------------

ifcapable vtab {


  proc hex2blob {hex} {
    # Split on newlines:
    set bytes [list]
    foreach l [split $hex "\n"] {
      if {[string is space $l]} continue
      set L [list]
................................................................................
  db close
  sqlite3 db test.db
  
  do_catchsql_test 3.3 {
    PRAGMA integrity_check;
  } {1 {database disk image is malformed}}


} ;# ifcapable vtab



finish_test







>







 







>





106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
...
216
217
218
219
220
221
222
223
224
225
226
227
228
do_catchsql_test 2.3 {
  INSERT INTO t1 VALUES(randomblob(900));
} {1 {database disk image is malformed}}

#-------------------------------------------------------------------------

ifcapable vtab {
if {[permutation]!="inmemory_journal"} {

  proc hex2blob {hex} {
    # Split on newlines:
    set bytes [list]
    foreach l [split $hex "\n"] {
      if {[string is space $l]} continue
      set L [list]
................................................................................
  db close
  sqlite3 db test.db
  
  do_catchsql_test 3.3 {
    PRAGMA integrity_check;
  } {1 {database disk image is malformed}}

} ;# [permutation]!="inmemory_journal"
} ;# ifcapable vtab



finish_test

Changes to test/dbpage.test.

17
18
19
20
21
22
23
24

25
26
27


28
29
30
31

32
33
34
35
36
37
38
39
set testprefix dbpage

ifcapable !vtab||!compound {
  finish_test
  return
}

do_execsql_test 100 {

  PRAGMA auto_vacuum=0;
  PRAGMA page_size=4096;
  PRAGMA journal_mode=WAL;


  CREATE TABLE t1(a,b);
  WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100)
  INSERT INTO t1(a,b) SELECT x, printf('%d-x%.*c',x,x,'x') FROM c;
  PRAGMA integrity_check;

} {wal ok}
do_execsql_test 110 {
  SELECT pgno, quote(substr(data,1,5)) FROM sqlite_dbpage('main') ORDER BY pgno;
} {1 X'53514C6974' 2 X'0500000001' 3 X'0D0000004E' 4 X'0D00000016'}
do_execsql_test 120 {
  SELECT pgno, quote(substr(data,1,5)) FROM sqlite_dbpage WHERE pgno=2;
} {2 X'0500000001'}
do_execsql_test 130 {







|
>
|
|
|
>
>
|
|
|
|
>
|







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
set testprefix dbpage

ifcapable !vtab||!compound {
  finish_test
  return
}

do_test 100 {
  execsql {
    PRAGMA auto_vacuum=0;
    PRAGMA page_size=4096;
    PRAGMA journal_mode=WAL;
  }
  execsql { 
    CREATE TABLE t1(a,b);
    WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100)
      INSERT INTO t1(a,b) SELECT x, printf('%d-x%.*c',x,x,'x') FROM c;
    PRAGMA integrity_check;
  }
} {ok}
do_execsql_test 110 {
  SELECT pgno, quote(substr(data,1,5)) FROM sqlite_dbpage('main') ORDER BY pgno;
} {1 X'53514C6974' 2 X'0500000001' 3 X'0D0000004E' 4 X'0D00000016'}
do_execsql_test 120 {
  SELECT pgno, quote(substr(data,1,5)) FROM sqlite_dbpage WHERE pgno=2;
} {2 X'0500000001'}
do_execsql_test 130 {