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

Unified Diff: third_party/sqlite/sqlite-src-3080704/test/sort2.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
Index: third_party/sqlite/sqlite-src-3080704/test/sort2.test
diff --git a/third_party/sqlite/sqlite-src-3080704/test/sort2.test b/third_party/sqlite/sqlite-src-3080704/test/sort2.test
new file mode 100644
index 0000000000000000000000000000000000000000..29001f00990093b8089255da4aa7ba7cdc8bbfea
--- /dev/null
+++ b/third_party/sqlite/sqlite-src-3080704/test/sort2.test
@@ -0,0 +1,80 @@
+# 2014 March 25.
+#
+# 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.
+#
+#***********************************************************************
+# This file implements regression tests for SQLite library.
+#
+# Specifically, the tests in this file attempt to verify that
+# multi-threaded sorting works.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix sort2
+
+foreach {tn script} {
+ 1 { }
+ 2 {
+ catch { db close }
+ reset_db
+ catch { db eval {PRAGMA threads=7} }
+ }
+} {
+
+ eval $script
+
+ do_execsql_test $tn.1 {
+ PRAGMA cache_size = 5;
+ WITH r(x,y) AS (
+ SELECT 1, randomblob(100)
+ UNION ALL
+ SELECT x+1, randomblob(100) FROM r
+ LIMIT 100000
+ )
+ SELECT count(x), length(y) FROM r GROUP BY (x%5)
+ } {
+ 20000 100 20000 100 20000 100 20000 100 20000 100
+ }
+
+ do_execsql_test $tn.2.1 {
+ CREATE TABLE t1(a, b);
+ WITH r(x,y) AS (
+ SELECT 1, randomblob(100)
+ UNION ALL
+ SELECT x+1, randomblob(100) FROM r
+ LIMIT 10000
+ ) INSERT INTO t1 SELECT * FROM r;
+ }
+
+ do_execsql_test $tn.2.2 {
+ CREATE UNIQUE INDEX i1 ON t1(b, a);
+ }
+
+ do_execsql_test $tn.2.3 {
+ CREATE UNIQUE INDEX i2 ON t1(a);
+ }
+
+ do_execsql_test $tn.2.4 { PRAGMA integrity_check } {ok}
+
+ breakpoint
+ do_execsql_test $tn.3 {
+ PRAGMA cache_size = 5;
+ WITH r(x,y) AS (
+ SELECT 1, randomblob(100)
+ UNION ALL
+ SELECT x+1, randomblob(100) FROM r
+ LIMIT 1000000
+ )
+ SELECT count(x), length(y) FROM r GROUP BY (x%5)
+ } {
+ 200000 100 200000 100 200000 100 200000 100 200000 100
+ }
+}
+
+finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3080704/test/sort.test ('k') | third_party/sqlite/sqlite-src-3080704/test/sort3.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698