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

Unified Diff: third_party/sqlite/src/ext/fts5/test/fts5integrity.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
Index: third_party/sqlite/src/ext/fts5/test/fts5integrity.test
diff --git a/third_party/sqlite/src/ext/fts5/test/fts5integrity.test b/third_party/sqlite/src/ext/fts5/test/fts5integrity.test
index 84490e0cb402c0c7fac83042c4e2de4ef16ed39a..37ca9331dd217457fca6fbf7df37e37cbdcafd49 100644
--- a/third_party/sqlite/src/ext/fts5/test/fts5integrity.test
+++ b/third_party/sqlite/src/ext/fts5/test/fts5integrity.test
@@ -145,10 +145,69 @@ do_execsql_test 5.2 {
INSERT INTO gg(gg) VALUES('optimize');
}
-breakpoint
do_execsql_test 5.3 {
INSERT INTO gg(gg) VALUES('integrity-check');
}
+do_test 5.4.1 {
+ set ok 0
+ for {set i 0} {$i < 10000} {incr i} {
+ set T [format %.5d $i]
+ set res [db eval { SELECT rowid FROM gg($T) ORDER BY rowid ASC }]
+ set res2 [db eval { SELECT rowid FROM gg($T) ORDER BY rowid DESC }]
+ if {$res == [lsort -integer $res2]} { incr ok }
+ }
+ set ok
+} {10000}
+
+do_test 5.4.2 {
+ set ok 0
+ for {set i 0} {$i < 100} {incr i} {
+ set T "[format %.3d $i]*"
+ set res [db eval { SELECT rowid FROM gg($T) ORDER BY rowid ASC }]
+ set res2 [db eval { SELECT rowid FROM gg($T) ORDER BY rowid DESC }]
+ if {$res == [lsort -integer $res2]} { incr ok }
+ }
+ set ok
+} {100}
+
+#-------------------------------------------------------------------------
+# Similar to 5.*.
+#
+foreach {tn pgsz} {
+ 1 32
+ 2 36
+ 3 40
+ 4 44
+ 5 48
+} {
+ do_execsql_test 6.$tn.1 {
+ DROP TABLE IF EXISTS hh;
+ CREATE VIRTUAL TABLE hh USING fts5(y);
+ INSERT INTO hh(hh, rank) VALUES('pgsz', $pgsz);
+
+ WITH s(i) AS (SELECT 0 UNION ALL SELECT i+1 FROM s WHERE i<999)
+ INSERT INTO hh SELECT printf("%.3d%.3d%.3d %.3d%.3d%.3d",i,i,i,i+1,i+1,i+1)
+ FROM s;
+
+ WITH s(i) AS (SELECT 0 UNION ALL SELECT i+1 FROM s WHERE i<999)
+ INSERT INTO hh SELECT printf("%.3d%.3d%.3d %.3d%.3d%.3d",i,i,i,i+1,i+1,i+1)
+ FROM s;
+
+ INSERT INTO hh(hh) VALUES('optimize');
+ }
+
+ do_test 6.$tn.2 {
+ set ok 0
+ for {set i 0} {$i < 1000} {incr i} {
+ set T [format %.3d%.3d%.3d $i $i $i]
+ set res [db eval { SELECT rowid FROM hh($T) ORDER BY rowid ASC }]
+ set res2 [db eval { SELECT rowid FROM hh($T) ORDER BY rowid DESC }]
+ if {$res == [lsort -integer $res2]} { incr ok }
+ }
+ set ok
+ } {1000}
+}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/ext/fts5/test/fts5hash.test ('k') | third_party/sqlite/src/ext/fts5/test/fts5matchinfo.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698