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

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

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/fts3first.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
index fb877737f4ef88b20fb995c0c5a9d74d410fee29..f2d10bc3f8476649153ef3a485e8e9a0cabbf9d1 100644
--- a/third_party/sqlite/src/test/fts3fault2.test
+++ b/third_party/sqlite/src/test/fts3fault2.test
@@ -82,4 +82,77 @@ do_faultsim_test 2.1 -prep {
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}}
}
+do_faultsim_test 3.0 -faults oom* -prep {
+ faultsim_delete_and_reopen
+ db eval { CREATE TABLE 'xx yy'(a, b); }
+} -body {
+ execsql {
+ CREATE VIRTUAL TABLE tt USING fts4(content="xx yy");
+ }
+} -test {
+ faultsim_test_result {0 {}}
+}
+
+do_faultsim_test 3.1 -faults oom* -prep {
+ faultsim_delete_and_reopen
+ db func zip zip
+ db func unzip unzip
+} -body {
+ execsql {
+ CREATE VIRTUAL TABLE tt USING fts4(compress=zip, uncompress=unzip);
+ }
+} -test {
+ faultsim_test_result {0 {}}
+}
+
+do_test 4.0 {
+ faultsim_delete_and_reopen
+ execsql {
+ CREATE VIRTUAL TABLE ft USING fts4(a, b);
+ INSERT INTO ft VALUES('U U T C O', 'F N D E S');
+ INSERT INTO ft VALUES('P H X G B', 'I D M R U');
+ INSERT INTO ft VALUES('P P X D M', 'Y V N T C');
+ INSERT INTO ft VALUES('Z L Q O W', 'D F U N Q');
+ INSERT INTO ft VALUES('A J D U P', 'C H M Q E');
+ INSERT INTO ft VALUES('P S A O H', 'S Z C W D');
+ INSERT INTO ft VALUES('T B N L W', 'C A K T I');
+ INSERT INTO ft VALUES('K E Z L O', 'L L Y C E');
+ INSERT INTO ft VALUES('C R E S V', 'Q V F W P');
+ INSERT INTO ft VALUES('S K H G W', 'R W Q F G');
+ }
+ faultsim_save_and_close
+} {}
+do_faultsim_test 4.1 -prep {
+ faultsim_restore_and_reopen
+ db eval {SELECT * FROM sqlite_master}
+} -body {
+ execsql { INSERT INTO ft(ft) VALUES('rebuild') }
+} -test {
+ faultsim_test_result {0 {}}
+}
+
+ifcapable fts3_unicode {
+ do_test 5.0 {
+ faultsim_delete_and_reopen
+ execsql {
+ CREATE VIRTUAL TABLE ft USING fts4(a, tokenize=unicode61);
+ }
+ faultsim_save_and_close
+ } {}
+
+ do_faultsim_test 5.1 -faults oom* -prep {
+ faultsim_restore_and_reopen
+ db eval {SELECT * FROM sqlite_master}
+ } -body {
+ execsql { INSERT INTO ft VALUES('the quick brown fox'); }
+ execsql { INSERT INTO ft VALUES(
+ 'theunusuallylongtokenthatjustdragsonandonandonandthendragsonsomemoreeof'
+ );
+ }
+ execsql { SELECT docid FROM ft WHERE ft MATCH 'th*' }
+ } -test {
+ faultsim_test_result {0 {1 2}}
+ }
+}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/fts3fault.test ('k') | third_party/sqlite/src/test/fts3first.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698