diff options
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/openv2.test')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/test/openv2.test | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/openv2.test b/libraries/sqlite/unix/sqlite-3.5.1/test/openv2.test new file mode 100644 index 0000000..637edc6 --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/test/openv2.test | |||
@@ -0,0 +1,41 @@ | |||
1 | # 2007 Sep 3 | ||
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 | # Tests on the sqlite3_open_v2() interface. | ||
13 | # | ||
14 | # $Id: openv2.test,v 1.1 2007/09/03 15:19:36 drh Exp $ | ||
15 | |||
16 | set testdir [file dirname $argv0] | ||
17 | source $testdir/tester.tcl | ||
18 | |||
19 | db close | ||
20 | file delete -force test.db test.db-journal | ||
21 | do_test openv2-1.1 { | ||
22 | set rc [catch {sqlite3 db test.db -create 0} msg] | ||
23 | lappend rc $msg | ||
24 | } {1 {unable to open database file}} | ||
25 | do_test openv2-1.2 { | ||
26 | info commands db | ||
27 | } {} | ||
28 | do_test openv2-1.3 { | ||
29 | sqlite3 db test.db | ||
30 | db eval {CREATE TABLE t1(x)} | ||
31 | db close | ||
32 | sqlite3 db test.db -readonly 1 | ||
33 | db eval {SELECT name FROM sqlite_master} | ||
34 | } {t1} | ||
35 | do_test openv2-1.4 { | ||
36 | catchsql { | ||
37 | INSERT INTO t1 VALUES(123) | ||
38 | } | ||
39 | } {1 {attempt to write a readonly database}} | ||
40 | |||
41 | finish_test | ||