/ Check-in [5bde5680]
Login

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

Overview
Comment:Update URI test cases to account for the new error message format.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5bde568028216f5bbf76fa0b61bf5b736699f4b1
User & Date: dan 2011-05-10 17:43:28
Context
2011-05-10
18:39
Have flags passed to sqlite3_open_v2() apply to the main and any attached databases. And change things so that any "mode=xxx" or "cache=xxx" options specified as part of a URI for the main database do not also apply to attached databases. check-in: 3e490915 user: dan tags: trunk
17:43
Update URI test cases to account for the new error message format. check-in: 5bde5680 user: dan tags: trunk
10:17
Add new documentation keywords to the sqlite3_vfs description. check-in: ad3389a9 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/e_uri.test.

315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
sqlite3 db test.db
db close
foreach {tn uri flags error} {
  1   {file:test.db?mode=ro}   ro    {not an error}
  2   {file:test.db?mode=ro}   rw    {not an error}
  3   {file:test.db?mode=ro}   rwc   {not an error}

  4   {file:test.db?mode=rw}   ro    {access permission denied}
  5   {file:test.db?mode=rw}   rw    {not an error}
  6   {file:test.db?mode=rw}   rwc   {not an error}

  7   {file:test.db?mode=rwc}  ro    {access permission denied}
  8   {file:test.db?mode=rwc}  rw    {access permission denied}
  9   {file:test.db?mode=rwc}  rwc   {not an error}
} {
  set f(ro)  [list SQLITE_OPEN_READONLY SQLITE_OPEN_URI]
  set f(rw)  [list SQLITE_OPEN_READWRITE SQLITE_OPEN_URI]
  set f(rwc) [list SQLITE_OPEN_READWRITE SQLITE_OPEN_CREATE SQLITE_OPEN_URI]

  set DB [sqlite3_open_v2 $uri $f($flags) ""]







|



|
|







315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
sqlite3 db test.db
db close
foreach {tn uri flags error} {
  1   {file:test.db?mode=ro}   ro    {not an error}
  2   {file:test.db?mode=ro}   rw    {not an error}
  3   {file:test.db?mode=ro}   rwc   {not an error}

  4   {file:test.db?mode=rw}   ro    {access mode not allowed: rw}
  5   {file:test.db?mode=rw}   rw    {not an error}
  6   {file:test.db?mode=rw}   rwc   {not an error}

  7   {file:test.db?mode=rwc}  ro    {access mode not allowed: rwc}
  8   {file:test.db?mode=rwc}  rw    {access mode not allowed: rwc}
  9   {file:test.db?mode=rwc}  rwc   {not an error}
} {
  set f(ro)  [list SQLITE_OPEN_READONLY SQLITE_OPEN_URI]
  set f(rw)  [list SQLITE_OPEN_READWRITE SQLITE_OPEN_URI]
  set f(rwc) [list SQLITE_OPEN_READWRITE SQLITE_OPEN_CREATE SQLITE_OPEN_URI]

  set DB [sqlite3_open_v2 $uri $f($flags) ""]

Changes to test/uri.test.

153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
  set A(0) {1 {attempt to write a readonly database}}
  do_test 4.1.$tn.2 {
    sqlite3 db "file:test.db?mode=$mode"
    catchsql { INSERT INTO t1 VALUES(1, 2) }
  } $A($write_ok)

  set A(1) {0 {}}
  set A(0) {1 {access permission denied}}
  do_test 4.1.$tn.3 {
    list [catch {sqlite3 db "file:test.db?mode=$mode" -readonly 1} msg] $msg
  } $A($readonly_ok)
}

set orig [sqlite3_enable_shared_cache]
foreach {tn options sc_default is_shared} {







|







153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
  set A(0) {1 {attempt to write a readonly database}}
  do_test 4.1.$tn.2 {
    sqlite3 db "file:test.db?mode=$mode"
    catchsql { INSERT INTO t1 VALUES(1, 2) }
  } $A($write_ok)

  set A(1) {0 {}}
  set A(0) [list 1 "access mode not allowed: $mode"]
  do_test 4.1.$tn.3 {
    list [catch {sqlite3 db "file:test.db?mode=$mode" -readonly 1} msg] $msg
  } $A($readonly_ok)
}

set orig [sqlite3_enable_shared_cache]
foreach {tn options sc_default is_shared} {