/ Check-in [227cfe11]
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 backup2.test so that it passes on OpenBSD (which produces a slightly different error message in one case).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 227cfe11c4a1c095ccad76116dc4a68cccc5e8f0
User & Date: dan 2012-01-13 15:21:07
Context
2012-01-13
15:50
Update the documentation for the sqlite3_uri_*() routines to make it clear that there argument must be a database filename passed into xOpen(). No changes to code. check-in: 08230a3a user: drh tags: trunk
15:21
Fix backup2.test so that it passes on OpenBSD (which produces a slightly different error message in one case). check-in: 227cfe11 user: dan tags: trunk
14:50
Do not throw an error from within test_journal.c if a database file size is not an integer multiple of the page-size. check-in: 3f4899a9 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/backup2.test.

138
139
140
141
142
143
144
145
146
147
148
149
150




151
152
153
154
155
156
157
158
159

160
161
162
163
164
165
166
  set rc [catch {db backup} res]
  lappend rc $res
} {1 {wrong # args: should be "db backup ?DATABASE? FILENAME"}}

# Try to restore from an unreadable file.
#
if {$tcl_platform(platform)=="windows"} {
  do_test backup2-10 {
    forcedelete bu3.db
    file mkdir bu3.db
    set rc [catch {db restore temp bu3.db} res]
    lappend rc $res
  } {1 {cannot open source database: unable to open database file}}




}
if {$tcl_platform(platform)!="windows"} {
  do_test backup2-10 {
    forcedelete bu3.db
    file mkdir bu3.db
    set rc [catch {db restore temp bu3.db} res]
    lappend rc $res
  } {1 {cannot open source database: disk I/O error}}
}


# Try to restore from something that is not a database file.
#
do_test backup2-11 {
  set rc [catch {db restore temp bu2.db} res]
  lappend rc $res
} {1 {restore failed: file is encrypted or is not a database}}







<
<
<
<
<
|
>
>
>
>

<
|
|
|
|
|
<
<
>







138
139
140
141
142
143
144





145
146
147
148
149
150

151
152
153
154
155


156
157
158
159
160
161
162
163
  set rc [catch {db backup} res]
  lappend rc $res
} {1 {wrong # args: should be "db backup ?DATABASE? FILENAME"}}

# Try to restore from an unreadable file.
#
if {$tcl_platform(platform)=="windows"} {





  set msg {cannot open source database: unable to open database file}
} elseif {$tcl_platform(os)=="OpenBSD"} {
  set msg {restore failed: file is encrypted or is not a database}
} else {
  set msg {cannot open source database: disk I/O error}
}

do_test backup2-10 {
  forcedelete bu3.db
  file mkdir bu3.db
  set rc [catch {db restore temp bu3.db} res]
  lappend rc $res


} [list 1 $msg]

# Try to restore from something that is not a database file.
#
do_test backup2-11 {
  set rc [catch {db restore temp bu2.db} res]
  lappend rc $res
} {1 {restore failed: file is encrypted or is not a database}}