Debian Codegraph @

ext/recover/recoverbuild.test

raw
1 # 2023 February 28
2 #
3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
5 #
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
9 #
10 #***********************************************************************
11 #
12
13 source [file join [file dirname [info script]] recover_common.tcl]
14 set testprefix recoverbuild
15
16
17 # The following tests verify that if the recovery extension is used with
18 # a build that does not support the sqlite_dbpage table, the error message
19 # is "no such table: sqlite_dbpage", and not something more generic.
20 #
21 reset_db
22 create_null_module db sqlite_dbpage
23 do_execsql_test 1.0 {
24 CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT);
25 INSERT INTO t1 VALUES(123, 'one hundred and twenty three');
26 }
27
28 forcedelete test.db2
29 do_test 1.1 {
30 set R [sqlite3_recover_init db main test.db2]
31 } {/sqlite_recover.*/}
32
33 do_test 1.2 {
34 $R run
35 } {1}
36
37 do_test 1.3 {
38 list [catch { $R finish } msg] $msg
39 } {1 {no such table: sqlite_dbpage}}
40
41 finish_test
42