From 487e15dc239ccdb3344d1c99ce120e872bab4a74 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 20 Sep 2012 18:34:38 -0400 Subject: Imported Upstream version 2.0.6 --- test/pragma.test | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'test/pragma.test') 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 -- cgit v1.2.3