/ Check-in [f4d234b5]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix some test scripts so that they work with various permutations.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f4d234b5013bf93b6eac7f8be6d4c074cf9f5293
User & Date: dan 2016-03-24 15:09:14
Context
2016-03-24
15:32
Larger margins for one memsubsys1 range check when running with a non-zero reserved-bytes value. check-in: 6db1d1fb user: drh tags: trunk
15:09
Fix some test scripts so that they work with various permutations. check-in: f4d234b5 user: dan tags: trunk
2016-03-23
17:54
Avoid calling realloc() with a zero size in fuzzcheck.c. check-in: a1fd1469 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/snapshot.test.

12
13
14
15
16
17
18









19
20
21
22
23
24
25
# of this file is the sqlite3_snapshot_xxx() APIs.
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !snapshot {finish_test; return}
set testprefix snapshot










#-------------------------------------------------------------------------
# Check some error conditions in snapshot_get(). It is an error if:
#
#  1) snapshot_get() is called on a non-WAL database, or
#  2) there is an open write transaction on the database.
#







>
>
>
>
>
>
>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# of this file is the sqlite3_snapshot_xxx() APIs.
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !snapshot {finish_test; return}
set testprefix snapshot

# This test does not work with the inmemory_journal permutation. The reason
# is that each connection opened as part of this permutation executes
# "PRAGMA journal_mode=memory", which fails if the database is in wal mode
# and there are one or more existing connections.
if {[permutation]=="inmemory_journal"} {
  finish_test
  return
}

#-------------------------------------------------------------------------
# Check some error conditions in snapshot_get(). It is an error if:
#
#  1) snapshot_get() is called on a non-WAL database, or
#  2) there is an open write transaction on the database.
#

Changes to test/snapshot_fault.test.

142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
    BEGIN;
  }
} -body {
  if { [catch { sqlite3_snapshot_open db main $::snapshot } msg] } {
    error $msg
  }
} -test {
  faultsim_test_result {0 {}} {1 SQLITE_IOERR} \
                              {1 SQLITE_IOERR_NOMEM} {1 SQLITE_IOERR_READ}
  if {$testrc==0} {
    set res [db eval { 
      SELECT a FROM t1;
      PRAGMA integrity_check;
    }]
    if {$res != "1 2 3 ok"} { error "res is $res" }







|







142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
    BEGIN;
  }
} -body {
  if { [catch { sqlite3_snapshot_open db main $::snapshot } msg] } {
    error $msg
  }
} -test {
  faultsim_test_result {0 {}} {1 SQLITE_IOERR} {1 SQLITE_NOMEM} \
                              {1 SQLITE_IOERR_NOMEM} {1 SQLITE_IOERR_READ}
  if {$testrc==0} {
    set res [db eval { 
      SELECT a FROM t1;
      PRAGMA integrity_check;
    }]
    if {$res != "1 2 3 ok"} { error "res is $res" }