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

Unified Diff: third_party/sqlite/sqlite-src-3070603/test/tkt2332.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-3070603/test/tkt2332.test
diff --git a/third_party/sqlite/sqlite-src-3070603/test/tkt2332.test b/third_party/sqlite/sqlite-src-3070603/test/tkt2332.test
new file mode 100644
index 0000000000000000000000000000000000000000..2d09dda6e3aae1ffcdcfd19f24d7bbbdcb3a6304
--- /dev/null
+++ b/third_party/sqlite/sqlite-src-3070603/test/tkt2332.test
@@ -0,0 +1,67 @@
+# 2007 May 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.
+#
+#***********************************************************************
+#
+# $Id: tkt2332.test,v 1.4 2007/09/12 17:01:45 danielk1977 Exp $
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+ifcapable !incrblob||!tclvar {
+ finish_test
+ return
+}
+
+do_test tkt2332.1 {
+ execsql {
+ CREATE TABLE blobs (k INTEGER PRIMARY KEY, v BLOB);
+ PRAGMA cache_size = 100;
+ }
+} {}
+
+set ::iKey 1
+foreach Len [list 10000 100000 1000000] {
+ do_test tkt2332.$Len.1 {
+ set val "[expr rand()][expr rand()][expr rand()][expr rand()][expr rand()]"
+ set ::blobstr [string range \
+ [string repeat $val [expr ($Len/[string length $val])+1]] 0 [expr $Len-1]
+ ]
+
+ db eval { INSERT INTO blobs VALUES($::iKey, zeroblob($Len)) }
+ } {}
+
+ do_test tkt2332.$Len.2 {
+ execsql {
+ SELECT length(v) FROM blobs WHERE k = $::iKey;
+ }
+ } $Len
+
+ do_test tkt2332.$Len.3 {
+ set ::fd [db incrblob blobs v $::iKey]
+ puts -nonewline $::fd $::blobstr
+ close $::fd
+ } {}
+
+ do_test tkt2332.$Len.4 {
+ execsql { SELECT length(v) FROM blobs WHERE k = $::iKey; }
+ } $Len
+
+ do_test tkt2332.$Len.5 {
+ lindex [execsql {SELECT v FROM blobs WHERE k = $::iKey}] 0
+ } $::blobstr
+
+ incr ::iKey
+}
+
+# Free memory:
+unset ::blobstr
+
+finish_test
« no previous file with comments | « third_party/sqlite/sqlite-src-3070603/test/tkt2285.test ('k') | third_party/sqlite/sqlite-src-3070603/test/tkt2339.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698