sl@0: # 2007 Sep 3 sl@0: # sl@0: # The author disclaims copyright to this source code. In place of sl@0: # a legal notice, here is a blessing: sl@0: # sl@0: # May you do good and not evil. sl@0: # May you find forgiveness for yourself and forgive others. sl@0: # May you share freely, never taking more than you give. sl@0: # sl@0: #*********************************************************************** sl@0: # sl@0: # Tests on the sqlite3_open_v2() interface. sl@0: # sl@0: # $Id: openv2.test,v 1.1 2007/09/03 15:19:36 drh Exp $ sl@0: sl@0: set testdir [file dirname $argv0] sl@0: source $testdir/tester.tcl sl@0: sl@0: db close sl@0: file delete -force test.db test.db-journal sl@0: do_test openv2-1.1 { sl@0: set rc [catch {sqlite3 db test.db -create 0} msg] sl@0: lappend rc $msg sl@0: } {1 {unable to open database file}} sl@0: do_test openv2-1.2 { sl@0: info commands db sl@0: } {} sl@0: do_test openv2-1.3 { sl@0: sqlite3 db test.db sl@0: db eval {CREATE TABLE t1(x)} sl@0: db close sl@0: sqlite3 db test.db -readonly 1 sl@0: db eval {SELECT name FROM sqlite_master} sl@0: } {t1} sl@0: do_test openv2-1.4 { sl@0: catchsql { sl@0: INSERT INTO t1 VALUES(123) sl@0: } sl@0: } {1 {attempt to write a readonly database}} sl@0: sl@0: finish_test