Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Unified Diff: third_party/sqlite/src/test/uri2.test

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/uri.test ('k') | third_party/sqlite/src/test/vacuum5.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/uri2.test
diff --git a/third_party/sqlite/src/test/uri2.test b/third_party/sqlite/src/test/uri2.test
new file mode 100644
index 0000000000000000000000000000000000000000..52feb7b50ffcbf9b44a831a6161c66333bddf979
--- /dev/null
+++ b/third_party/sqlite/src/test/uri2.test
@@ -0,0 +1,63 @@
+# 2016 October 26
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# Tests for SQLITE_ENABLE_URI_00_ERROR builds.
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+ifcapable !uri_00_error {
+ finish_test
+ return
+}
+
+set testprefix uri2
+db close
+sqlite3_shutdown
+sqlite3_config_uri 1
+
+foreach {tn uri} {
+ 1 file:test.db%00trailing
+ 2 file:test.db?%00trailing=1
+ 3 file:test.db?trailing=1%00
+ 4 file:test.db?trailing=1&abc%00def
+ 5 file:test.db?trailing=1&abc%00def
+} {
+ do_test 1.$tn.1 {
+ set rc [catch { sqlite3 db $uri } msg]
+ list $rc $msg
+ } {1 {unexpected %00 in uri}}
+
+ do_test 1.$tn.2 {
+ set DB2 [sqlite3_open $uri]
+ sqlite3_errcode $DB2
+ } {SQLITE_ERROR}
+
+ catch { sqlite3_close $DB2 }
+
+ do_test 1.$tn.2 {
+ sqlite3 db ""
+ catchsql { ATTACH $uri AS aux }
+ } {1 {unexpected %00 in uri}}
+
+ do_test 1.$tn.3 {
+ sqlite3_errcode db
+ } {SQLITE_ERROR}
+
+ catch { db close }
+}
+
+reset_db
+do_test 2.0 {
+ expr {[lsearch [execsql {PRAGMA compile_options}] ENABLE_URI_00_ERROR] >= 0}
+} 1
+
+finish_test
« no previous file with comments | « third_party/sqlite/src/test/uri.test ('k') | third_party/sqlite/src/test/vacuum5.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698