From 5550517e2b594688055cbaab90ae5dcae5734315 Mon Sep 17 00:00:00 2001 From: shaneh Date: Tue, 21 Jun 2011 19:30:19 +0000 Subject: [PATCH] Update a few of the uri tests to work on Windows. FossilOrigin-Name: a2a0cd4aa4a6723a849bbba590c22fd065fab55e --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/e_uri.test | 46 ++++++++++++++++++++++------------------------ test/tester.tcl | 13 +++++++++++++ 4 files changed, 43 insertions(+), 32 deletions(-) diff --git a/manifest b/manifest index b2e0dd90ab..3a9e0a51a3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Updates\sto\snmake\smakefile\sto\sallow\soptions\sto\sbe\spassed\sto\slib.exe. -D 2011-06-21T18:12:07.861 +C Update\sa\sfew\sof\sthe\suri\stests\sto\swork\son\sWindows. +D 2011-06-21T19:30:19.621 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in c1d7a7f4fd8da6b1815032efca950e3d5125407e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -382,7 +382,7 @@ F test/e_resolve.test dcce9308fb13b934ce29591105d031d3e14fbba6 F test/e_select.test 7ac53674e822d4d77bbb4a9a4aaefa5fdc9e493f F test/e_select2.test 5c3d3da19c7b3e90ae444579db2b70098599ab92 F test/e_update.test b926341a65955d69a6375c9eb4fd82e7089bc83a -F test/e_uri.test 8b943bc63cd1abb037430214cdb618422e6bf7d6 +F test/e_uri.test 6f35b491f80dac005c8144f38b2dfb4d96483596 F test/e_vacuum.test 6c09c2af7f2f140518f371c5342100118f779dcf F test/enc.test e54531cd6bf941ee6760be041dff19a104c7acea F test/enc2.test 6d91a5286f59add0cfcbb2d0da913b76f2242398 @@ -695,7 +695,7 @@ F test/tclsqlite.test 8c154101e704170c2be10f137a5499ac2c6da8d3 F test/tempdb.test 19d0f66e2e3eeffd68661a11c83ba5e6ace9128c F test/temptable.test f42121a0d29a62f00f93274464164177ab1cc24a F test/temptrigger.test b0273db072ce5f37cf19140ceb1f0d524bbe9f05 -F test/tester.tcl 78e63a11eaaec5c2b3c74977d61bf70666d8393f +F test/tester.tcl 7c02f342a92aa161d13ab5241413e341039c14d7 F test/thread001.test a3e6a7254d1cb057836cb3145b60c10bf5b7e60f F test/thread002.test afd20095e6e845b405df4f2c920cb93301ca69db F test/thread003.test b824d4f52b870ae39fc5bae4d8070eca73085dca @@ -948,7 +948,7 @@ F tool/symbols.sh bc2a3709940d47c8ac8e0a1fdf17ec801f015a00 F tool/tostr.awk 11760e1b94a5d3dcd42378f3cc18544c06cfa576 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings.sh 347d974d143cf132f953b565fbc03026f19fcb4d -P 1577484595b5e5aab93722d76b273c911a04dc2c -R f7161c21d188b4f81e0b1fd792d695ed +P 9eac4a6bbe111d951ad23395ba82c868473c5b9b +R cb165167c8ffaaf3fa41940019e90c06 U shaneh -Z e880ef5fa1c4608e76d3b05c69240aa9 +Z 2a57b2d9aba31bd124d18eb8ab4bf292 diff --git a/manifest.uuid b/manifest.uuid index 7b2af80620..40cb51dc84 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9eac4a6bbe111d951ad23395ba82c868473c5b9b \ No newline at end of file +a2a0cd4aa4a6723a849bbba590c22fd065fab55e \ No newline at end of file diff --git a/test/e_uri.test b/test/e_uri.test index b6ad54ea03..5275ec1b54 100644 --- a/test/e_uri.test +++ b/test/e_uri.test @@ -121,6 +121,10 @@ if {$tcl_platform(platform) == "unix"} { sqlite3_close $DB } +# ensure uri processing enabled for the rest of the tests +sqlite3_shutdown +sqlite3_config_uri 1 + # EVIDENCE-OF: R-17482-00398 If the authority is not an empty string or # "localhost", an error is returned to the caller. # @@ -144,18 +148,16 @@ if {$tcl_platform(platform) == "unix"} { # EVIDENCE-OF: R-45981-25528 The fragment component of a URI, if # present, is ignored. # -# It is difficult to test that something is ignore correctly. So these tests +# It is difficult to test that something is ignored correctly. So these tests # just show that adding a fragment does not interfere with the pathname or # parameters passed through to the VFS xOpen() methods. # -if {$tcl_platform(platform) == "unix"} { - foreach {tn uri parse} " - 1 {file:test.db#abc} {[pwd]/test.db {}} - 2 {file:test.db?a=b#abc} {[pwd]/test.db {a b}} - 3 {file:test.db?a=b#?c=d} {[pwd]/test.db {a b}} - " { - do_test 3.$tn { parse_uri $uri } $parse - } +foreach {tn uri parse} " + 1 {file:test.db#abc} {[pwd]/test.db {}} + 2 {file:test.db?a=b#abc} {[pwd]/test.db {a b}} + 3 {file:test.db?a=b#?c=d} {[pwd]/test.db {a b}} +" { + do_filepath_test 3.$tn { parse_uri $uri } $parse } # EVIDENCE-OF: R-62557-09390 SQLite uses the path component of the URI @@ -168,16 +170,14 @@ if {$tcl_platform(platform) == "unix"} { # (meaning that the authority section is omitted from the URI) then the # path is interpreted as a relative path. # -if {$tcl_platform(platform) == "unix"} { - foreach {tn uri parse} " - 1 {file:test.db} {[pwd]/test.db {}} - 2 {file:/test.db} {/test.db {}} - 3 {file:///test.db} {/test.db {}} - 4 {file://localhost/test.db} {/test.db {}} - 5 {file:/a/b/c/test.db} {/a/b/c/test.db {}} - " { - do_test 4.$tn { parse_uri $uri } $parse - } +foreach {tn uri parse} " + 1 {file:test.db} {[pwd]/test.db {}} + 2 {file:/test.db} {/test.db {}} + 3 {file:///test.db} {/test.db {}} + 4 {file://localhost/test.db} {/test.db {}} + 5 {file:/a/b/c/test.db} {/a/b/c/test.db {}} +" { + do_filepath_test 4.$tn { parse_uri $uri } $parse } # EVIDENCE-OF: R-01612-30877 The "vfs" parameter may be used to specify @@ -270,8 +270,6 @@ foreach {tn uri error} " # EVIDENCE-OF: R-26845-32976 Value "rwc" is equivalent to setting both # SQLITE_OPEN_READWRITE and SQLITE_OPEN_CREATE. # -sqlite3_shutdown -sqlite3_config_uri 1 foreach {tn uri read write create} { 1 {file:test.db?mode=ro} 1 0 0 2 {file:test.db?mode=rw} 1 1 0 @@ -429,10 +427,10 @@ sqlite3_enable_shared_cache $orig # EVIDENCE-OF: R-63472-46769 Specifying an unknown parameter in the # query component of a URI is not an error. # -do_test 12.1 { +do_filepath_test 12.1 { parse_uri file://localhost/test.db?an=unknown¶meter=is&ok= } {/test.db {an unknown parameter is ok {}}} -do_test 12.2 { +do_filepath_test 12.2 { parse_uri file://localhost/test.db?an&unknown¶meter&is&ok } {/test.db {an {} unknown {} parameter {} is {} ok {}}} @@ -452,7 +450,7 @@ foreach {tn uri parse} " 2 {file:/test.db?%68%65%6c%6c%6f=%77%6f%72%6c%64} {/test.db {hello world}} 3 {file:/%C3%BF.db} {/\xFF.db {}} " { - do_test 13.$tn { parse_uri $uri } $parse + do_filepath_test 13.$tn { parse_uri $uri } $parse } finish_test diff --git a/test/tester.tcl b/test/tester.tcl index 5a936bd9c9..6d84949f76 100644 --- a/test/tester.tcl +++ b/test/tester.tcl @@ -354,6 +354,19 @@ proc do_test {name cmd expected} { flush stdout } +proc filepath_normalize {p} { + # test cases should be written to assume "unix"-like file paths + if {$::tcl_platform(platform)!="unix"} { + # lreverse*2 as a hack to remove any unneeded {} after the string map + lreverse [lreverse [string map {\\ /} [regsub -nocase -all {[a-z]:[/\\]+} $p {/}]]] + } +} +proc do_filepath_test {name cmd expected} { + uplevel [list do_test $name [ + subst -nocommands { filepath_normalize [ $cmd ] } + ] [filepath_normalize $expected]] +} + proc realnum_normalize {r} { # different TCL versions display floating point values differently. string map {1.#INF inf Inf inf .0e e} [regsub -all {(e[+-])0+} $r {\1}] -- 2.47.2