From: drh Date: Tue, 18 Mar 2008 13:46:53 +0000 (+0000) Subject: Test script changes that go with the coverage enhancements of the X-Git-Tag: version-3.6.10~1299 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d19744f353d7ef9478cf577b101baa125fbfc481;p=thirdparty%2Fsqlite.git Test script changes that go with the coverage enhancements of the previous check-in. (CVS 4878) FossilOrigin-Name: f87ddf83a5d1340652f222972a7d75f4fdbe776b --- diff --git a/manifest b/manifest index dd0a459a1c..56020fdf3f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Minor\stest\scoverage\senhancements.\s(CVS\s4877) -D 2008-03-18T13:01:38 +C Test\sscript\schanges\sthat\sgo\swith\sthe\scoverage\senhancements\sof\sthe\nprevious\scheck-in.\s(CVS\s4878) +D 2008-03-18T13:46:53 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in 5be94fea84f1599672e5041de03b97990baca593 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -413,7 +413,7 @@ F test/pager2.test c025f91b75fe65e85febda64d9416428b8a5cab5 F test/pager3.test 2323bf27fd5bd887b580247e5bce500ceee994b4 F test/pageropt.test 51e3c091bc2992f5098f7576e3594e1908988939 F test/pagesize.test e0a8b3fe80f8b8e808d94a00734c7a18c76c407e -F test/pragma.test d9f3d80583b80708aa270e8c5038dee949190d78 +F test/pragma.test a16e6c08d4b85d1eb0ecfb490f6fa1e2d6342043 F test/pragma2.test 5364893491b9231dd170e3459bfc2e2342658b47 F test/printf.test c3405535b418d454e8a52196a0fc592ec9eec58d F test/progress.test 5b075c3c790c7b2a61419bc199db87aaf48b8301 x @@ -424,7 +424,7 @@ F test/rdonly.test b34db316525440d3b42c32e83942c02c37d28ef0 F test/reindex.test 38b138abe36bf9a08c791ed44d9f76cd6b97b78b F test/rollback.test 0bd29070ba2f76da939347773fbda53337ebd61c F test/rowid.test 1c8fc43c60d273e6ea44dfb992db587f3164312c -F test/safety.test 1b585c4311c85a6a7aa747b7b45a6bbc6d04fbe0 +F test/safety.test b69e2b2dd5d52a3f78e216967086884bbc1a09c6 F test/schema.test a8b000723375fd42c68d310091bdbd744fde647c F test/schema2.test 35e1c9696443d6694c8980c411497c2b5190d32e F test/select1.test 871df931cbbc0e78170605628e8b5fc60765e265 @@ -623,7 +623,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P b9c5dce34985f7e6d1b6314ae8674f07d0bf518b -R 67aaf9a613e3c2a3d49f99caa50102da +P edd207b9a9df5d73ec34474a4e90fcb592f06cf1 +R 4c32224dd22a5f74d7f84201633ed292 U drh -Z 4730a7cecf64579e388237eb2277c2bb +Z 6ec7b57f051cece6980e6912c8801c48 diff --git a/manifest.uuid b/manifest.uuid index 91d9502c8d..d7beb7e35a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -edd207b9a9df5d73ec34474a4e90fcb592f06cf1 \ No newline at end of file +f87ddf83a5d1340652f222972a7d75f4fdbe776b \ No newline at end of file diff --git a/test/pragma.test b/test/pragma.test index 84fbca92bc..af886e533e 100644 --- a/test/pragma.test +++ b/test/pragma.test @@ -12,7 +12,7 @@ # # This file implements tests for the PRAGMA command. # -# $Id: pragma.test,v 1.57 2008/01/20 23:19:58 drh Exp $ +# $Id: pragma.test,v 1.58 2008/03/18 13:46:53 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -813,6 +813,23 @@ do_test pragma-8.2.15 { } {-450} } ; # ifcapable schema_version +# Check to see if TEMP_STORE is memory or disk. Return strings +# "memory" or "disk" as appropriate. +# +proc check_temp_store {} { + db eval {CREATE TEMP TABLE IF NOT EXISTS a(b)} + db eval {PRAGMA database_list} { + if {$name=="temp"} { + if {$file==""} { + return "memory" + } else { + return "disk" + } + } + } + return "unknown" +} + # Test temp_store and temp_store_directory pragmas # @@ -824,18 +841,54 @@ do_test pragma-9.1 { PRAGMA temp_store; } } {0} +if {$TEMP_STORE<=1} { + do_test pragma-9.1.1 { + check_temp_store + } {disk} +} else { + do_test pragma-9.1.1 { + check_temp_store + } {memory} +} + do_test pragma-9.2 { + db close + sqlite3 db test.db execsql { PRAGMA temp_store=file; PRAGMA temp_store; } } {1} +if {$TEMP_STORE==3} { + # When TEMP_STORE is 3, always use memory regardless of pragma settings. + do_test pragma-9.2.1 { + check_temp_store + } {memory} +} else { + do_test pragma-9.2.1 { + check_temp_store + } {disk} +} + do_test pragma-9.3 { + db close + sqlite3 db test.db execsql { PRAGMA temp_store=memory; PRAGMA temp_store; } } {2} +if {$TEMP_STORE==0} { + # When TEMP_STORE is 0, always use the disk regardless of pragma settings. + do_test pragma-9.3.1 { + check_temp_store + } {disk} +} else { + do_test pragma-9.3.1 { + check_temp_store + } {memory} +} + do_test pragma-9.4 { execsql { PRAGMA temp_store_directory; diff --git a/test/safety.test b/test/safety.test index ebbe8ec439..9cca57c1c4 100644 --- a/test/safety.test +++ b/test/safety.test @@ -13,7 +13,7 @@ # functions. Those routines are not strictly necessary - they are # designed to detect misuse of the library. # -# $Id: safety.test,v 1.3 2008/01/23 03:03:05 drh Exp $ +# $Id: safety.test,v 1.4 2008/03/18 13:46:53 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -24,6 +24,20 @@ ifcapable !debug { return } +# Return the UTF-8 representation of the supplied UTF-16 string $str. +proc utf8 {str} { + # If $str ends in two 0x00 0x00 bytes, knock these off before + # converting to UTF-8 using TCL. + binary scan $str \c* vals + if {[lindex $vals end]==0 && [lindex $vals end-1]==0} { + set str [binary format \c* [lrange $vals 0 end-2]] + } + + set r [encoding convertfrom unicode $str] + return $r +} + + do_test safety-1.1 { set DB [sqlite3_connection_pointer db] db eval {CREATE TABLE t1(a)} @@ -46,6 +60,11 @@ do_test safety-2.1 { SELECT safety_on(), name FROM sqlite_master } } {1 {library routine called out of sequence}} +ifcapable {utf16} { + do_test safety-2.1.1 { + utf8 [sqlite3_errmsg16 db] + } {library routine called out of sequence} +} do_test safety-2.2 { catchsql { SELECT 'hello'