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

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

Issue 6990047: Import SQLite 3.7.6.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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/fts3fault.test ('k') | third_party/sqlite/src/test/fts3malloc.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/fts3fault2.test
diff --git a/third_party/sqlite/src/test/fts3fault2.test b/third_party/sqlite/src/test/fts3fault2.test
new file mode 100644
index 0000000000000000000000000000000000000000..fb877737f4ef88b20fb995c0c5a9d74d410fee29
--- /dev/null
+++ b/third_party/sqlite/src/test/fts3fault2.test
@@ -0,0 +1,85 @@
+# 2011 February 3
+#
+# 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.
+#
+#***********************************************************************
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set ::testprefix fts3fault2
+
+# If SQLITE_ENABLE_FTS3 is not defined, omit this file.
+ifcapable !fts3 { finish_test ; return }
+
+do_test 1.0 {
+ execsql {
+ CREATE VIRTUAL TABLE t1 USING fts4(x);
+ INSERT INTO t1 VALUES('a b c');
+ INSERT INTO t1 VALUES('c d e');
+ CREATE VIRTUAL TABLE terms USING fts4aux(t1);
+ }
+ faultsim_save_and_close
+} {}
+
+do_faultsim_test 1.1 -prep {
+ faultsim_restore_and_reopen
+ db eval {SELECT * FROM sqlite_master}
+} -body {
+ execsql "CREATE VIRTUAL TABLE terms2 USING fts4aux(t1)"
+} -test {
+ faultsim_test_result {0 {}}
+}
+
+do_faultsim_test 1.2 -prep {
+ faultsim_restore_and_reopen
+ db eval {SELECT * FROM sqlite_master}
+} -body {
+ execsql "SELECT * FROM terms"
+} -test {
+ faultsim_test_result {0 {a * 1 1 a 0 1 1 b * 1 1 b 0 1 1 c * 2 2 c 0 2 2 d * 1 1 d 0 1 1 e * 1 1 e 0 1 1}}
+}
+
+do_faultsim_test 1.3 -prep {
+ faultsim_restore_and_reopen
+ db eval {SELECT * FROM sqlite_master}
+} -body {
+ execsql "SELECT * FROM terms WHERE term>'a' AND TERM < 'd'"
+} -test {
+ faultsim_test_result {0 {b * 1 1 b 0 1 1 c * 2 2 c 0 2 2}}
+}
+
+do_faultsim_test 1.4 -prep {
+ faultsim_restore_and_reopen
+ db eval {SELECT * FROM sqlite_master}
+} -body {
+ execsql "SELECT * FROM terms WHERE term='c'"
+} -test {
+ faultsim_test_result {0 {c * 2 2 c 0 2 2}}
+}
+
+do_test 2.0 {
+ faultsim_delete_and_reopen
+ execsql {
+ CREATE VIRTUAL TABLE tx USING fts4(a, b);
+ INSERT INTO tx VALUES('a b c', 'x y z');
+ CREATE VIRTUAL TABLE terms2 USING fts4aux(tx);
+ }
+ faultsim_save_and_close
+} {}
+
+do_faultsim_test 2.1 -prep {
+ faultsim_restore_and_reopen
+ db eval {SELECT * FROM sqlite_master}
+} -body {
+ execsql "SELECT * FROM terms2"
+} -test {
+ faultsim_test_result {0 {a * 1 1 a 0 1 1 b * 1 1 b 0 1 1 c * 1 1 c 0 1 1 x * 1 1 x 1 1 1 y * 1 1 y 1 1 1 z * 1 1 z 1 1 1}}
+}
+
+finish_test
« no previous file with comments | « third_party/sqlite/src/test/fts3fault.test ('k') | third_party/sqlite/src/test/fts3malloc.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698