diff options
author | Hans-Christoph Steiner <hans@eds.org> | 2012-09-20 18:34:38 -0400 |
---|---|---|
committer | Hans-Christoph Steiner <hans@eds.org> | 2012-09-20 18:34:38 -0400 |
commit | 487e15dc239ccdb3344d1c99ce120e872bab4a74 (patch) | |
tree | c986d492f6092ca7b4401d91515f74daed17fae2 /test/pragma.test | |
parent | 7bb481fda9ecb134804b49c2ce77ca28f7eea583 (diff) |
Imported Upstream version 2.0.6
Diffstat (limited to 'test/pragma.test')
-rw-r--r-- | test/pragma.test | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/test/pragma.test b/test/pragma.test index 0cad25a..bb10327 100644 --- a/test/pragma.test +++ b/test/pragma.test @@ -99,7 +99,7 @@ do_test pragma-1.5 { PRAGMA default_cache_size; PRAGMA synchronous; } -} [list 4321 $DFLT_CACHE_SZ 0] +} [list -4321 $DFLT_CACHE_SZ 0] do_test pragma-1.6 { execsql { PRAGMA synchronous=ON; @@ -107,7 +107,7 @@ do_test pragma-1.6 { PRAGMA default_cache_size; PRAGMA synchronous; } -} [list 4321 $DFLT_CACHE_SZ 1] +} [list -4321 $DFLT_CACHE_SZ 1] do_test pragma-1.7 { db close sqlite3 db test.db @@ -990,7 +990,7 @@ do_test pragma-9.4 { } {} ifcapable wsd { do_test pragma-9.5 { - set pwd [string map {' ''} [file nativename [pwd]]] + set pwd [string map {' ''} [file nativename [get_pwd]]] execsql " PRAGMA temp_store_directory='$pwd'; " @@ -999,7 +999,7 @@ ifcapable wsd { execsql { PRAGMA temp_store_directory; } - } [list [file nativename [pwd]]] + } [list [file nativename [get_pwd]]] do_test pragma-9.7 { catchsql { PRAGMA temp_store_directory='/NON/EXISTENT/PATH/FOOBAR'; @@ -1489,4 +1489,26 @@ foreach {temp_setting val} { } $val } +# The SQLITE_FCNTL_PRAGMA logic, with error handling. +# +db close +testvfs tvfs +sqlite3 db test.db -vfs tvfs +do_test pragma-19.1 { + catchsql {PRAGMA error} +} {1 {SQL logic error or missing database}} +do_test pragma-19.2 { + catchsql {PRAGMA error='This is the error message'} +} {1 {This is the error message}} +do_test pragma-19.3 { + catchsql {PRAGMA error='7 This is the error message'} +} {1 {This is the error message}} +do_test pragma-19.4 { + catchsql {PRAGMA error=7} +} {1 {out of memory}} +do_test pragma-19.5 { + file tail [lindex [execsql {PRAGMA filename}] 0] +} {test.db} + + finish_test |